[0m06:57:21.447567 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:57:21.455323 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:57:21.455323 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:57:21.459995 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:57:21.461001 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:57:21.461001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:57:21.461001 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.462514 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.462514 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:57:21.462514 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.466156 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:57:21.467242 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:57:21.467778 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:57:21.467778 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:57:21.468788 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:57:21.468788 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:57:21.468788 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:57:21.470300 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:57:21.471310 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:57:21.472450 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:57:21.476872 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:57:21.477972 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:57:21.480535 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:57:21.480535 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:57:21.482042 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:57:21.482042 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.482042 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.483047 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:57:21.483047 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.487585 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:57:21.489137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:57:21.490266 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:57:21.490266 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:57:21.490266 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:57:21.491295 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:57:21.491801 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:57:21.491801 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:57:21.492805 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:57:21.492805 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:57:21.496439 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:57:21.497417 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:57:21.498444 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:57:21.500893 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:57:21.500893 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:57:21.500893 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.501898 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.501898 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:57:21.501898 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.502897 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.502897 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:57:21.504456 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:57:21.505116 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:57:21.505637 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m06:57:21.505637 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:57:21.506646 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:57:21.507156 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:57:21.508343 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:57:21.508343 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:57:21.510893 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:57:21.512398 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:57:21.515436 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:57:21.516440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:57:21.516440 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:57:21.517071 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.517071 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.517071 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:57:21.518076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.518076 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.519077 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:57:21.520583 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:57:21.520583 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:57:21.521205 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:57:21.522299 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:57:21.522299 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:57:21.522823 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:57:21.523331 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:57:21.523331 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:57:21.526965 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:57:21.527971 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:57:21.530096 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:57:21.532622 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:57:21.532622 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:57:21.533627 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.533627 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.533627 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:57:21.534628 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.535630 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:57:21.537761 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:57:21.538421 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:57:21.538421 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:57:21.539543 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:57:21.539543 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:57:21.539543 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:57:21.540679 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:57:21.540679 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:57:21.541676 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:57:21.545200 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:57:21.546211 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:57:21.548731 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:57:21.548731 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:57:21.550341 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:57:21.550341 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.550889 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.550889 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:57:21.550889 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.555446 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:57:21.556456 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:57:21.558699 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:57:21.558699 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:57:21.559983 [info ] [Thread-1 (]: 41 of 97 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:57:21.562674 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:57:21.562674 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:57:21.563796 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:57:21.564851 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:57:21.565358 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:57:21.568746 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:57:21.568746 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:57:21.572334 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:57:21.573342 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:57:21.573342 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:57:21.573342 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.574388 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.574388 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:57:21.574388 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.575443 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.577212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:57:21.578219 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:57:21.578219 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:57:21.578219 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m06:57:21.579724 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:57:21.579724 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:57:21.580282 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:57:21.580282 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:57:21.580282 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:57:21.586189 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:57:21.587477 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:57:21.590339 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:57:21.591539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:57:21.592101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:57:21.592101 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.592101 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.593106 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:57:21.593106 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.594105 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.595154 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:57:21.595154 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:57:21.596167 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:57:21.596167 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.02s]
[0m06:57:21.597673 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:57:21.597673 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:57:21.598680 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:57:21.598680 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:57:21.598680 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:57:21.603257 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:57:21.605737 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:57:21.608355 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:57:21.610077 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:57:21.611084 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:57:21.611084 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.611084 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.612589 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:57:21.612589 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.614693 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:57:21.614693 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:57:21.617073 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:57:21.617606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:57:21.617606 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:57:21.618611 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:57:21.618611 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:57:21.618611 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:57:21.619613 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:57:21.619613 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:57:21.623690 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:57:21.624823 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:57:21.627993 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:57:21.627993 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:57:21.629496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:57:21.629496 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.630173 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.630173 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:57:21.630173 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.633687 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:57:21.635466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:57:21.635466 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:57:21.636496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:57:21.636496 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:57:21.637477 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:57:21.638671 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:57:21.638671 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:57:21.640184 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:57:21.640184 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:57:21.642724 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:57:21.644228 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:57:21.645738 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:57:21.647745 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:57:21.648249 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:57:21.648249 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.648764 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.649341 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:57:21.649859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.650441 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.651008 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:57:21.653233 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:57:21.653233 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:57:21.653233 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m06:57:21.653233 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:57:21.653233 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:57:21.655666 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:57:21.655666 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:57:21.655666 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:57:21.659654 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:57:21.661167 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:57:21.665098 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:57:21.667177 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:57:21.668188 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:57:21.669189 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.669189 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.670185 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:57:21.670185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.671193 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.671798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:57:21.672360 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:57:21.673365 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:57:21.673365 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:57:21.674528 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:57:21.674528 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:57:21.674528 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:57:21.676060 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:57:21.676060 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:57:21.681012 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:57:21.682709 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:57:21.685790 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:57:21.686982 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:57:21.688096 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:57:21.688644 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.689657 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.690169 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:57:21.690786 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.694794 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:57:21.697400 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:57:21.697400 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:57:21.698534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:57:21.698534 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:57:21.698534 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:57:21.698534 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:57:21.700189 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:57:21.700189 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:57:21.701196 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:57:21.705551 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:57:21.705551 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:57:21.708668 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:57:21.710703 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:57:21.710703 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:57:21.712219 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.712219 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.712219 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:57:21.713251 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.719275 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:57:21.720796 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:57:21.721474 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:57:21.721474 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:57:21.721474 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:57:21.722478 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:57:21.722478 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:57:21.722478 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:57:21.723528 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:57:21.724087 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:57:21.728066 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:57:21.728066 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:57:21.731196 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:57:21.732224 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:57:21.732224 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:57:21.732768 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.732768 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.733422 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:57:21.733422 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.734027 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.735032 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:57:21.736031 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:57:21.736031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:57:21.736031 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m06:57:21.737534 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:57:21.737534 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:57:21.737534 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:57:21.738541 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:57:21.738541 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:57:21.742271 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:57:21.742776 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:57:21.744282 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:57:21.745792 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:57:21.745792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:57:21.745792 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.745792 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.747299 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:57:21.747299 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.747299 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.749923 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:57:21.750428 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:57:21.750428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:57:21.751054 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m06:57:21.751054 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:57:21.751054 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:57:21.751054 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:57:21.752727 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:57:21.753277 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:57:21.757109 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:57:21.759222 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:57:21.762290 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:57:21.763798 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:57:21.763798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:57:21.764825 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.764825 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.766639 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:57:21.766639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.767219 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.769239 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:57:21.769239 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:57:21.770224 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:57:21.770729 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:57:21.771234 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:57:21.771930 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:57:21.771930 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:57:21.772510 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:57:21.772510 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:57:21.778447 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:57:21.780564 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:57:21.786116 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:57:21.787379 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:57:21.787379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:57:21.787978 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.787978 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.787978 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:57:21.787978 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.790559 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.792133 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:57:21.792133 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:57:21.793158 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:57:21.793158 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:57:21.794137 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:57:21.794642 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:57:21.796311 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:57:21.796869 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:57:21.797903 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:57:21.801259 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:57:21.803260 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:57:21.808213 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:57:21.809891 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:57:21.809891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:57:21.809891 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.810897 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.810897 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:57:21.810897 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.812402 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.813426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:57:21.814022 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:57:21.814022 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:57:21.814022 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:57:21.815026 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:57:21.815026 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:57:21.816152 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:57:21.816152 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:57:21.816152 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:57:21.818768 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:57:21.821282 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:57:21.823451 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:57:21.824583 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:57:21.824583 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:57:21.825117 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.825117 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.825117 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:57:21.826122 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.827121 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.827624 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:57:21.828744 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:57:21.829629 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:57:21.829629 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:57:21.830131 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:57:21.830684 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:57:21.830684 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:57:21.830684 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:57:21.830684 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:57:21.836898 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:57:21.837951 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:57:21.840223 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:57:21.841778 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:57:21.842783 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:57:21.842783 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.842783 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.842783 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:57:21.842783 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.845317 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:57:21.847305 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:57:21.847305 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:57:21.848327 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:57:21.848327 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:57:21.848327 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:57:21.848327 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:57:21.849938 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:57:21.850547 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:57:21.850547 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:57:21.854628 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:57:21.855656 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:57:21.857943 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:57:21.858645 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:57:21.859659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:57:21.859659 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.860226 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.860226 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:57:21.861234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.863987 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:57:21.865015 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:57:21.866619 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:57:21.867126 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:57:21.867126 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:57:21.868131 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:57:21.868131 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:57:21.868131 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:57:21.869132 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:57:21.869132 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:57:21.872463 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:57:21.873475 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:57:21.875557 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:57:21.875557 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:57:21.875557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:57:21.877197 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.877197 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.877197 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:57:21.877197 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.878225 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.879747 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:57:21.880370 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:57:21.880370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:57:21.880370 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:57:21.881957 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:57:21.881957 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:57:21.882570 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:57:21.882570 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:57:21.882570 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:57:21.886590 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:57:21.888640 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:57:21.890180 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:57:21.891685 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:57:21.891685 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:57:21.891685 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.892705 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.892705 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:57:21.892705 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.892705 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.894229 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:57:21.895245 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:57:21.895245 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:57:21.896306 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:57:21.896306 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:57:21.897278 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:57:21.897278 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:57:21.897783 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:57:21.897783 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:57:21.901117 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:57:21.902659 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:57:21.904380 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:57:21.905481 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:57:21.905481 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:57:21.905481 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.905481 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.907282 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:57:21.907282 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.910154 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:57:21.911162 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:57:21.912665 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:57:21.913422 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:57:21.913995 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:57:21.914574 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:57:21.914574 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:57:21.915098 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:57:21.915640 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:57:21.916151 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:57:21.919668 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:57:21.920666 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:57:21.922374 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:57:21.922374 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:57:21.922374 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:57:21.924031 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.924648 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.924648 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:57:21.925198 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:21.929419 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:57:21.930456 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:57:21.931973 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:57:21.931973 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:57:21.932980 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:57:21.932980 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:57:21.933984 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:57:21.933984 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:57:21.934986 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:57:21.934986 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:57:21.938500 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:57:21.939588 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:57:21.942247 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:57:21.943252 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:57:21.944253 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:57:21.944759 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:21.945772 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.946278 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:57:21.946278 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:57:21.947283 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.948797 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:57:21.949802 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:57:21.949802 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.951026 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:57:21.951026 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:57:21.951026 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:57:21.953271 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:21.955109 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:57:21.955109 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:57:21.955679 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:21.958020 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:57:21.958722 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBD135F6E0>]}
[0m06:57:22.989503 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:57:22.991678 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.02s]
[0m06:57:22.992726 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:57:22.994232 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:57:22.994232 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:57:22.995239 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:57:22.995744 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:57:23.001289 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:57:23.001796 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:57:23.004577 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:57:23.005601 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:57:23.005601 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:57:23.005601 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.006694 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.006694 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:57:23.007773 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:57:23.008383 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.010928 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:57:23.011954 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:57:23.012473 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.015018 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:57:23.016026 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:57:23.016026 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:57:23.018380 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:57:23.022448 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:57:23.022956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:57:23.024013 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.026143 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:57:23.027782 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBEFE9F410>]}
[0m06:57:23.028792 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.03s]
[0m06:57:23.029789 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:57:23.030294 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:57:23.030294 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:57:23.031865 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:57:23.031865 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:57:23.035877 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:57:23.037382 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:57:23.040545 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:57:23.042051 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:57:23.042583 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:57:23.042583 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.042583 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.042583 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:57:23.044109 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:57:23.044109 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.047262 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:57:23.047262 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:57:23.048836 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.049862 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:57:23.049862 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:57:23.050387 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:57:23.051037 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.052636 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:57:23.053300 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:57:23.053300 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.054324 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:57:23.055369 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBD0D1E570>]}
[0m06:57:23.055369 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:57:23.056488 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:57:23.056488 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:57:23.057495 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:57:23.057999 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:57:23.057999 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:57:23.061257 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:57:23.062240 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:57:23.065305 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:57:23.066309 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:57:23.066858 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:57:23.066858 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.066858 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.067864 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:57:23.067864 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:57:23.068864 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.072585 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:57:23.072585 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:57:23.073688 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.074757 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:57:23.075900 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:57:23.075900 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:57:23.078975 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:57:23.083005 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:57:23.083005 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:57:23.084028 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.085020 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:57:23.086005 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBEFE678F0>]}
[0m06:57:23.086005 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m06:57:23.086005 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:57:23.086005 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:57:23.087509 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:57:23.087509 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:57:23.088515 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:57:23.090023 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:57:23.092151 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:57:23.094155 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:57:23.096586 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:57:23.096586 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:57:23.096586 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.098101 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.098606 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:57:23.098606 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:57:23.098606 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.101737 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:57:23.101737 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:57:23.101737 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.103331 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:57:23.103331 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:57:23.103331 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:57:23.103331 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.106858 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:57:23.107377 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:57:23.107942 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.108460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:57:23.109061 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBD137EC90>]}
[0m06:57:23.109577 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.02s]
[0m06:57:23.110186 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:57:23.110186 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:57:23.111193 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:57:23.112193 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:57:23.112193 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:57:23.114047 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:57:23.115086 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:57:23.120253 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:57:23.121263 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:57:23.121856 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:57:23.121856 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.122394 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.122394 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:57:23.122996 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:57:23.123542 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.126770 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:57:23.126770 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:57:23.127773 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.127773 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:57:23.128789 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:57:23.128789 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:57:23.130441 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.133067 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:57:23.134035 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:57:23.134035 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.135061 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:57:23.135061 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBD12BC1A0>]}
[0m06:57:23.136052 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.02s]
[0m06:57:23.136052 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:57:23.136052 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:57:23.137559 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:57:23.138206 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:57:23.138206 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:57:23.140779 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:57:23.142186 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:57:23.144195 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:57:23.146352 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:57:23.146856 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:57:23.147390 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.147390 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.147390 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:57:23.147390 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:57:23.148420 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.150231 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:57:23.151235 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:57:23.151235 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.152817 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:57:23.153543 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:57:23.153543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:57:23.154671 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.155805 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:57:23.156834 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:57:23.157423 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.158000 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:57:23.158540 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBEFE7CEC0>]}
[0m06:57:23.158540 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m06:57:23.159546 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:57:23.160050 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:57:23.160050 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:57:23.161055 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:57:23.161055 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:57:23.163570 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:57:23.164075 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:57:23.167368 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:57:23.169374 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:57:23.169374 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:57:23.169374 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.170374 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.170374 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:57:23.171481 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:57:23.172493 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.177157 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:57:23.177157 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:57:23.177661 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.179671 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:57:23.180180 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:57:23.180180 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:57:23.181188 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.183286 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:57:23.183286 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:57:23.184279 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.185265 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:57:23.186280 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBD0D1C110>]}
[0m06:57:23.186280 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.03s]
[0m06:57:23.187265 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:57:23.187841 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:57:23.187841 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:57:23.187841 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:57:23.187841 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:57:23.191551 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:57:23.192074 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:57:23.195599 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:57:23.195599 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:57:23.196605 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:57:23.196605 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.197605 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.197605 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:57:23.198110 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:57:23.198615 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.200824 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:57:23.202483 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:57:23.203107 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.204139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:57:23.204752 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:57:23.204752 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:57:23.205355 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.207404 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:57:23.207952 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:57:23.208533 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.209540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:57:23.210042 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBEFE87830>]}
[0m06:57:23.210042 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m06:57:23.211047 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:57:23.211047 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:57:23.211047 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:57:23.211047 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:57:23.212552 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:57:23.215171 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:57:23.216182 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:57:23.219135 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:57:23.220639 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:57:23.221812 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:57:23.222366 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.222366 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.223396 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:57:23.223396 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:57:23.223396 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.226040 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:57:23.226040 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:57:23.227058 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.228066 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:57:23.228066 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:57:23.228066 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:57:23.229570 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.232174 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:57:23.232685 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:57:23.232685 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.233692 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:57:23.234692 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBF0278500>]}
[0m06:57:23.234692 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m06:57:23.235692 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:57:23.235692 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:57:23.236692 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:57:23.236692 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:57:23.236692 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:57:23.240800 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:57:23.241772 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:57:23.244097 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:57:23.244097 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:57:23.244097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:57:23.245750 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.245750 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.245750 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:57:23.246756 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:57:23.246756 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.248792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:57:23.250534 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:57:23.250534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:57:23.251106 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m06:57:23.251106 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:57:23.252663 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:57:23.252663 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:57:23.253264 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:57:23.253264 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:57:23.258073 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:57:23.258652 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:57:23.260842 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:57:23.260842 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:57:23.260842 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:57:23.262350 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.262350 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.263357 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:57:23.263862 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:23.264872 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.266856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:57:23.266856 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:57:23.266856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:57:23.268410 [error] [Thread-1 (]: 73 of 97 FAIL 1 relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[31mFAIL 1[0m in 0.02s]
[0m06:57:23.268410 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:57:23.269422 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:57:23.269422 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0' to be skipped because of status 'fail'.  Reason: Got 1 result, configured to fail if != 0.
[0m06:57:23.270422 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:57:23.271481 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:57:23.272043 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:57:23.274869 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:57:23.275486 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:57:23.278033 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:57:23.278033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:57:23.278033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:57:23.279538 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.280174 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.280174 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:57:23.280174 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:57:23.282498 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.284487 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:57:23.285510 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:57:23.286485 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:57:23.286485 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m06:57:23.287492 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:57:23.287492 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:57:23.288566 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:57:23.288566 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:57:23.288566 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:57:23.292224 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:57:23.293236 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:57:23.295536 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:57:23.296560 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:57:23.297553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:57:23.298057 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.298563 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.298563 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:57:23.300131 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:57:23.301314 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.302868 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:57:23.304447 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:57:23.306606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:57:23.306606 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.02s]
[0m06:57:23.308288 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:57:23.308288 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:57:23.308288 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:57:23.309295 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:57:23.309295 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:57:23.314750 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:57:23.316849 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:57:23.318854 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:57:23.320368 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:57:23.321378 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:57:23.321884 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.322388 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.322388 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:57:23.322388 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:23.323901 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.325414 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:57:23.325414 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:57:23.325414 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:57:23.326856 [error] [Thread-1 (]: 76 of 97 FAIL 1852 relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[31mFAIL 1852[0m in 0.02s]
[0m06:57:23.328866 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:57:23.329867 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:57:23.329867 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e' to be skipped because of status 'fail'.  Reason: Got 1852 results, configured to fail if != 0.
[0m06:57:23.331152 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:57:23.332148 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:57:23.332148 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:57:23.335245 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:57:23.336746 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:57:23.337903 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:57:23.339544 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:57:23.339544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:57:23.339544 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.340553 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.340553 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:57:23.340553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:57:23.343581 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:57:23.345634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:57:23.346648 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:57:23.346648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:57:23.346648 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m06:57:23.347651 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:57:23.347651 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:57:23.348740 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:57:23.348740 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:57:23.348740 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:57:23.353221 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:57:23.354230 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:57:23.355277 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:57:23.357486 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:57:23.358089 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:57:23.358603 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.358603 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.358603 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:57:23.359615 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:57:23.361133 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.362639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:57:23.363664 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:57:23.363664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:57:23.363664 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:57:23.364771 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:57:23.364771 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:57:23.364771 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:57:23.364771 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:57:23.366303 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:57:23.370370 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:57:23.370370 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:57:23.373002 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:57:23.374609 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:57:23.375618 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:57:23.376123 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.376123 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.376123 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:57:23.377127 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:23.378132 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.379672 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:57:23.380364 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:57:23.380364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:57:23.380364 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m06:57:23.381947 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:57:23.381947 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:57:23.381947 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:57:23.381947 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:57:23.383465 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:57:23.386486 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:57:23.387471 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:57:23.389525 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:57:23.391665 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:57:23.392170 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:57:23.392170 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.392170 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.393178 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:57:23.393178 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:57:23.394683 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:23.396196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:57:23.396196 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:57:23.396196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:57:23.397701 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:57:23.397701 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:57:23.397701 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:57:23.398708 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:57:23.399214 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:57:23.399214 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:57:23.402881 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:57:23.405484 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:57:23.409111 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:57:23.410221 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:57:23.410221 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:57:23.411235 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:23.411235 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:23.412242 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:57:23.412242 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:57:30.621285 [debug] [Thread-1 (]: SQL status: OK in 7.209 seconds
[0m06:57:30.623657 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:57:30.623657 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:57:30.624465 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:30.625471 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:57:30.625976 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:57:30.625976 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:57:30.753380 [debug] [Thread-1 (]: SQL status: OK in 0.127 seconds
[0m06:57:30.755879 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:57:30.755879 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:57:30.756515 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:30.757522 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:57:30.758028 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBEFE45820>]}
[0m06:57:30.758028 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 7.36s]
[0m06:57:30.759378 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:57:30.759378 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:57:30.759995 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:57:30.759995 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:57:30.760999 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:57:30.763788 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:57:30.763788 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:57:30.766594 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:57:30.767269 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:57:30.767269 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:57:30.768303 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:30.768303 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:30.768303 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:57:30.769297 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:57:30.907164 [debug] [Thread-1 (]: SQL status: OK in 0.138 seconds
[0m06:57:30.909833 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:57:30.909833 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:57:30.909833 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:30.910841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:57:30.910841 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:57:30.910841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:57:30.917953 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:57:30.920280 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:57:30.920280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:57:30.921285 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:30.922695 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:57:30.922695 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBEFE66510>]}
[0m06:57:30.924203 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.16s]
[0m06:57:30.924792 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:57:30.925454 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:57:30.925454 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:57:30.925454 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:57:30.925454 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:57:30.931190 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:57:30.933404 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:57:30.937934 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:57:30.939481 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:57:30.939481 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:57:30.939481 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:30.940531 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:30.940531 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:57:30.941489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:57:42.319059 [debug] [Thread-1 (]: SQL status: OK in 11.377 seconds
[0m06:57:42.321301 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:57:42.322310 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:57:42.322817 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:42.323321 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:57:42.324326 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:57:42.324326 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:57:42.367885 [debug] [Thread-1 (]: SQL status: OK in 0.043 seconds
[0m06:57:42.370445 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:57:42.371181 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:57:42.371836 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:42.372381 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:57:42.372381 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBF0275820>]}
[0m06:57:42.373410 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 11.45s]
[0m06:57:42.373410 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:57:42.374515 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:57:42.375024 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:57:42.375531 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:57:42.375531 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:57:42.378065 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:57:42.380208 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:57:42.382349 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:57:42.384354 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:57:42.384354 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:57:42.384354 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:42.385381 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:42.385381 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:57:42.385381 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:57:42.608273 [debug] [Thread-1 (]: SQL status: OK in 0.221 seconds
[0m06:57:42.610486 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:57:42.610486 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:57:42.610486 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:42.611643 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:57:42.612643 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:57:42.612643 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:57:42.620463 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:57:42.622219 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:57:42.622886 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:57:42.622886 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:42.624450 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:57:42.624957 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBD0BDC410>]}
[0m06:57:42.624957 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.25s]
[0m06:57:42.625513 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:57:42.625513 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:57:42.625513 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:57:42.627093 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:57:42.627093 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:57:42.630200 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:57:42.631206 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:57:42.633330 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:57:42.634331 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:57:42.634331 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:57:42.634331 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:42.635339 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:42.635339 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:57:42.635339 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:57:42.939689 [debug] [Thread-1 (]: SQL status: OK in 0.304 seconds
[0m06:57:42.943660 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:57:42.944180 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:57:42.944180 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:42.944180 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:57:42.945957 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:57:42.945957 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:57:42.989659 [debug] [Thread-1 (]: SQL status: OK in 0.044 seconds
[0m06:57:42.992171 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:57:42.992171 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:57:42.992171 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:42.993177 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:57:42.994177 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9d596606-5b5a-4aa5-8117-3bdb6008cd9b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBD137BAD0>]}
[0m06:57:42.994177 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.37s]
[0m06:57:42.994177 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:57:42.996066 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:57:42.996066 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:57:42.996656 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:57:42.996656 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:57:42.998740 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:57:43.000959 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:57:43.003381 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:57:43.004394 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:57:43.004899 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:57:43.005404 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.005404 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.005404 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:57:43.005404 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.007166 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.008174 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:57:43.008679 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:57:43.009712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:57:43.010429 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:57:43.010429 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:57:43.010429 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:57:43.011442 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:57:43.011442 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:57:43.012454 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:57:43.016173 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:57:43.017684 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:57:43.019194 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:57:43.021551 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:57:43.021551 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:57:43.021551 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.022558 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.023565 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:57:43.023565 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.025290 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.025290 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:57:43.027154 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:57:43.027867 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:57:43.027867 [error] [Thread-1 (]: 87 of 97 FAIL 1527 relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[31mFAIL 1527[0m in 0.02s]
[0m06:57:43.028864 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:57:43.028864 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:57:43.029866 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e' to be skipped because of status 'fail'.  Reason: Got 1527 results, configured to fail if != 0.
[0m06:57:43.029866 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:57:43.031321 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:57:43.031321 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:57:43.034399 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:57:43.035399 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:57:43.039481 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:57:43.040487 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:57:43.040487 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:57:43.040487 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.041488 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.042711 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:57:43.044349 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:57:43.045875 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.047383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:57:43.049075 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:57:43.049075 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:57:43.050585 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m06:57:43.052249 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:57:43.053091 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:57:43.053091 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:57:43.053594 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:57:43.054296 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:57:43.058044 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:57:43.059458 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:57:43.063543 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:57:43.065134 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:57:43.066145 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:57:43.066145 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.067150 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.067150 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:57:43.067654 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.067654 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.069659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:57:43.069659 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:57:43.070687 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:57:43.071305 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:57:43.072418 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:57:43.072941 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:57:43.073458 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:57:43.073458 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:57:43.074492 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:57:43.078262 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:57:43.079768 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:57:43.080351 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:57:43.082936 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:57:43.082936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:57:43.082936 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.083936 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.083936 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:57:43.083936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.085936 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.085936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:57:43.087480 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:57:43.087480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:57:43.088503 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:57:43.088503 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:57:43.089486 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:57:43.089991 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:57:43.089991 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:57:43.089991 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:57:43.093230 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:57:43.097585 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:57:43.100507 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:57:43.102606 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:57:43.102606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:57:43.103141 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.103141 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.103141 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:57:43.104147 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.104653 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.105660 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:57:43.107136 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:57:43.107842 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:57:43.107842 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.02s]
[0m06:57:43.108416 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:57:43.108416 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:57:43.109422 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:57:43.109422 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:57:43.109422 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:57:43.113262 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:57:43.114798 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:57:43.118157 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:57:43.120660 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:57:43.121263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:57:43.121816 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.122492 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.124005 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:57:43.124572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.125117 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.127631 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:57:43.127631 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:57:43.128635 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:57:43.128635 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.02s]
[0m06:57:43.129637 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:57:43.130142 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:57:43.130142 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:57:43.130142 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:57:43.130142 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:57:43.134250 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:57:43.135249 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:57:43.137760 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:57:43.139446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:57:43.139446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:57:43.140453 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.140453 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.140453 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:57:43.141462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.142102 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.143115 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:57:43.144131 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:57:43.144131 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:57:43.144131 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.01s]
[0m06:57:43.145719 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:57:43.145719 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:57:43.145719 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:57:43.146445 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:57:43.146445 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:57:43.151073 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:57:43.153610 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:57:43.157135 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:57:43.157638 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:57:43.158642 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:57:43.158642 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.159144 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.159651 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:57:43.160225 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.161230 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.162230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:57:43.162735 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:57:43.162735 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:57:43.163741 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m06:57:43.164748 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:57:43.164748 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:57:43.164748 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:57:43.164748 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:57:43.164748 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:57:43.170395 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:57:43.171400 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:57:43.172407 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:57:43.174158 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:57:43.174158 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:57:43.174691 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.175218 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.175218 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:57:43.175218 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.177763 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:57:43.179776 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:57:43.180584 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:57:43.180584 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:57:43.180584 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m06:57:43.180584 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:57:43.182174 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:57:43.183179 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:57:43.184181 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:57:43.184181 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:57:43.187690 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:57:43.189700 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:57:43.191711 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:57:43.192717 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:57:43.192717 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:57:43.193716 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.194232 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.194232 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:57:43.194232 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.195247 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.196595 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:57:43.197594 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:57:43.197594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:57:43.198127 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.01s]
[0m06:57:43.198633 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:57:43.198633 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:57:43.198633 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:57:43.198633 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:57:43.200270 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:57:43.203413 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:57:43.204929 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:57:43.206943 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:57:43.208091 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:57:43.208627 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:57:43.208627 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:57:43.209140 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:57:43.209651 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:57:43.209651 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:57:43.211306 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:57:43.212308 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:57:43.212813 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:57:43.213318 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:57:43.213853 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.02s]
[0m06:57:43.213853 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:57:43.214860 [debug] [MainThread]: Using duckdb connection "master"
[0m06:57:43.214860 [debug] [MainThread]: On master: BEGIN
[0m06:57:43.214860 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:57:43.216475 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:57:43.216475 [debug] [MainThread]: On master: COMMIT
[0m06:57:43.217081 [debug] [MainThread]: Using duckdb connection "master"
[0m06:57:43.217081 [debug] [MainThread]: On master: COMMIT
[0m06:57:43.217081 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:57:43.217081 [debug] [MainThread]: On master: Close
[0m06:57:43.218087 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:57:43.218087 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:57:43.218087 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:57:43.218087 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:57:43.219086 [info ] [MainThread]: 
[0m06:57:43.219086 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 32.40 seconds (32.40s).
[0m06:57:43.226888 [debug] [MainThread]: Command end result
[0m06:57:43.261490 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:57:43.264261 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:57:43.271066 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:57:43.271693 [info ] [MainThread]: 
[0m06:57:43.272224 [info ] [MainThread]: [31mCompleted with 3 errors, 0 partial successes, and 0 warnings:[0m
[0m06:57:43.272224 [info ] [MainThread]: 
[0m06:57:43.272224 [error] [MainThread]: [31mFailure in test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_ (models\gold\schema.yml)[0m
[0m06:57:43.273819 [error] [MainThread]:   Got 1 result, configured to fail if != 0
[0m06:57:43.273819 [info ] [MainThread]: 
[0m06:57:43.274389 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_dim_instituicao_b5bf1250f8e22e22ed6029d8a9776333.sql
[0m06:57:43.274389 [info ] [MainThread]: 
[0m06:57:43.275394 [error] [MainThread]: [31mFailure in test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_ (models\gold\schema.yml)[0m
[0m06:57:43.275394 [error] [MainThread]:   Got 1852 results, configured to fail if != 0
[0m06:57:43.275394 [info ] [MainThread]: 
[0m06:57:43.276459 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_dim_instituicao_0eacdd127a052df6ef946b12273a2332.sql
[0m06:57:43.276459 [info ] [MainThread]: 
[0m06:57:43.276972 [error] [MainThread]: [31mFailure in test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_ (models\gold\schema.yml)[0m
[0m06:57:43.276972 [error] [MainThread]:   Got 1527 results, configured to fail if != 0
[0m06:57:43.277977 [info ] [MainThread]: 
[0m06:57:43.277977 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_dim_instituicao_cf3f8176c8c99f31e0910db0802babb1.sql
[0m06:57:43.277977 [info ] [MainThread]: 
[0m06:57:43.277977 [info ] [MainThread]: Done. PASS=94 WARN=0 ERROR=3 SKIP=0 NO-OP=0 TOTAL=97
[0m06:57:43.279486 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 22 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:57:43.281045 [debug] [MainThread]: Command `dbt build` failed at 06:57:43.280034 after 39.46 seconds
[0m06:57:43.282066 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBCB54E7E0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBCEA30D40>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001FBCC9B6EA0>]}
[0m06:57:43.282066 [debug] [MainThread]: Flushing usage events
[0m06:57:44.192797 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m07:06:57.480363 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA1381B50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA181D820>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA3AD7710>]}


============================== 07:06:57.488003 | 1775fe0e-0ecd-4ae9-919b-b20f496ee701 ==============================
[0m07:06:57.488003 [info ] [MainThread]: Running with dbt=1.11.5
[0m07:06:57.488003 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'use_colors': 'True', 'invocation_command': 'dbt build', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m07:06:57.698364 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA3AD7D70>]}
[0m07:06:57.745734 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA459E420>]}
[0m07:06:57.749284 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m07:06:57.948899 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m07:06:58.111630 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 2 files changed.
[0m07:06:58.112142 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m07:06:58.112142 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_capital_prudencial.sql
[0m07:06:58.112142 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m07:06:58.112142 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m07:06:58.113745 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m07:06:58.113745 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m07:06:58.113745 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m07:06:58.113745 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m07:06:58.114752 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\dim_instituicao.sql
[0m07:06:58.114752 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://seeds\seed_dim_classe_instituicao.csv
[0m07:06:58.587633 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m07:06:58.588792 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA62B9490>]}
[0m07:06:58.750223 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m07:06:58.760389 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA62AA930>]}
[0m07:06:58.839516 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:06:58.844873 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:06:58.902950 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA5FFCDA0>]}
[0m07:06:58.902950 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m07:06:58.909747 [info ] [MainThread]: 
[0m07:06:58.910284 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m07:06:58.910284 [info ] [MainThread]: 
[0m07:06:58.911295 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m07:06:58.916962 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m07:06:59.005785 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m07:06:59.005785 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m07:06:59.006795 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:06:59.572454 [debug] [ThreadPool]: SQL status: OK in 0.566 seconds
[0m07:06:59.573478 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m07:06:59.573983 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m07:06:59.573983 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m07:06:59.578842 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:06:59.578842 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m07:06:59.578842 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m07:06:59.579863 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m07:06:59.581018 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:06:59.581018 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m07:06:59.581018 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:06:59.582001 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:06:59.582001 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m07:06:59.582001 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:06:59.583090 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:06:59.583090 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:06:59.583090 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:06:59.583090 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:06:59.583090 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m07:06:59.586073 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m07:06:59.589596 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:06:59.589596 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m07:06:59.589596 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:06:59.590772 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:06:59.590772 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:06:59.590772 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m07:06:59.601020 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m07:06:59.601525 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m07:06:59.603035 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m07:06:59.603035 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m07:06:59.603035 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA611F5F0>]}
[0m07:06:59.603035 [debug] [MainThread]: Using duckdb connection "master"
[0m07:06:59.603035 [debug] [MainThread]: On master: BEGIN
[0m07:06:59.603035 [debug] [MainThread]: Opening a new connection, currently in state init
[0m07:06:59.605378 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:06:59.605378 [debug] [MainThread]: On master: COMMIT
[0m07:06:59.605378 [debug] [MainThread]: Using duckdb connection "master"
[0m07:06:59.605378 [debug] [MainThread]: On master: COMMIT
[0m07:06:59.606407 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:06:59.606407 [debug] [MainThread]: On master: Close
[0m07:06:59.609838 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:06:59.609838 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m07:06:59.610482 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m07:06:59.610482 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m07:06:59.624050 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:06:59.624625 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m07:06:59.648704 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:06:59.651103 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:06:59.651103 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m07:06:59.651103 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m07:06:59.651103 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:06:59.651103 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:06:59.652883 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    md5(cast(cast(codigo_origem as bigint) as varchar))
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
QUALIFY row_number() OVER (PARTITION BY codigo_origem ORDER BY tipo_instituicao) = 1
    );
  
  
[0m07:07:00.122504 [debug] [Thread-1 (]: SQL status: OK in 0.468 seconds
[0m07:07:00.126900 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:07:00.126900 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m07:07:00.127929 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.136540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:07:00.136540 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:07:00.136540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:07:00.145485 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m07:07:00.150146 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:07:00.150146 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m07:07:00.151176 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.152741 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m07:07:00.154945 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA6821BE0>]}
[0m07:07:00.155457 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.54s]
[0m07:07:00.155457 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:07:00.156498 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:07:00.156498 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m07:07:00.157556 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m07:07:00.157556 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m07:07:00.160348 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:07:00.161378 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m07:07:00.163433 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:07:00.164024 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:07:00.164024 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m07:07:00.165055 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:00.165598 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.165598 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:07:00.166124 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m07:07:00.216504 [debug] [Thread-1 (]: SQL status: OK in 0.050 seconds
[0m07:07:00.219689 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:07:00.219689 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m07:07:00.221194 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.221738 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:07:00.222355 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:07:00.222355 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:07:00.228906 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:07:00.231920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:07:00.232607 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m07:07:00.233621 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.236616 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m07:07:00.237616 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79990D0>]}
[0m07:07:00.238123 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.08s]
[0m07:07:00.238123 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:07:00.238123 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m07:07:00.239653 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m07:07:00.239653 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m07:07:00.240684 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m07:07:00.249010 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:07:00.250527 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m07:07:00.253141 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:07:00.256219 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:07:00.256724 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m07:07:00.257311 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:00.257311 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:00.258316 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:07:00.258821 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m07:07:00.330160 [debug] [Thread-1 (]: SQL status: OK in 0.071 seconds
[0m07:07:00.332673 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:07:00.333676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m07:07:00.333676 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.335678 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:07:00.335678 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:07:00.335678 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:07:00.337676 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:00.341041 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:07:00.341552 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m07:07:00.342139 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.343144 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m07:07:00.343144 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA6895310>]}
[0m07:07:00.344144 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m07:07:00.344144 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m07:07:00.345214 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:07:00.345214 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m07:07:00.346242 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m07:07:00.346242 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:07:00.350251 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:07:00.351771 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:07:00.353458 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:07:00.354979 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:07:00.354979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m07:07:00.355487 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:00.356127 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:00.356127 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:07:00.356648 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        -- Ativos
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        -- Passivos
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        (a.ativo_total - l.patrimonio_liquido) as passivo_total,
        l.captacoes
    FROM "silver"."main"."prudential_conglomerates_assets" a
    FULL OUTER JOIN "silver"."main"."prudential_conglomerates_liabilities" l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        -- Ativos
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        -- Passivos
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        (a.ativo_total - l.patrimonio_liquido) as passivo_total,
        l.captacoes
    FROM "silver"."main"."financial_conglomerates_assets" a
    FULL OUTER JOIN "silver"."main"."financial_conglomerates_liabilities" l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        -- Ativos
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        -- Passivos
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        (a.ativo_total - l.patrimonio_liquido) as passivo_total,
        l.captacoes
    FROM "silver"."main"."individual_institutions_assets" a
    FULL OUTER JOIN "silver"."main"."individual_institutions_liabilities" l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m07:07:00.794330 [debug] [Thread-1 (]: SQL status: OK in 0.437 seconds
[0m07:07:00.797638 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:07:00.798141 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m07:07:00.798643 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:00.798643 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:07:00.800365 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:07:00.800365 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:07:00.945799 [debug] [Thread-1 (]: SQL status: OK in 0.145 seconds
[0m07:07:00.948021 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:07:00.948536 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m07:07:00.948536 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.950084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m07:07:00.950727 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA68AD460>]}
[0m07:07:00.951291 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.60s]
[0m07:07:00.951291 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:07:00.951291 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:07:00.952844 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m07:07:00.952844 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m07:07:00.952844 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:07:00.958284 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:07:00.960408 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:07:00.963946 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:07:00.966485 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:07:00.966990 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m07:07:00.966990 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:00.966990 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:00.967997 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:07:00.967997 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m07:07:01.116883 [debug] [Thread-1 (]: SQL status: OK in 0.148 seconds
[0m07:07:01.119536 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:07:01.119536 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m07:07:01.120535 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:01.121782 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m07:07:01.122368 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:07:01.122368 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m07:07:01.136475 [debug] [Thread-1 (]: SQL status: OK in 0.014 seconds
[0m07:07:01.138563 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:07:01.138563 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m07:07:01.139579 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:01.140648 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m07:07:01.140648 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA7969580>]}
[0m07:07:01.140648 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.19s]
[0m07:07:01.141648 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:07:01.142152 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:07:01.142152 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m07:07:01.143173 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m07:07:01.143173 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:07:01.145253 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:07:01.146948 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:07:01.149736 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:07:01.151306 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:07:01.151938 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m07:07:01.152457 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:01.152457 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:01.153067 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:07:01.153067 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m07:07:01.194210 [debug] [Thread-1 (]: SQL status: OK in 0.041 seconds
[0m07:07:01.196536 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:07:01.197544 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m07:07:01.197544 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:01.198599 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m07:07:01.198599 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:07:01.198599 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m07:07:01.245737 [debug] [Thread-1 (]: SQL status: OK in 0.047 seconds
[0m07:07:01.250364 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:07:01.251816 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m07:07:01.252980 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:01.255766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m07:07:01.256273 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79D4B30>]}
[0m07:07:01.257354 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.11s]
[0m07:07:01.258495 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:07:01.258495 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:07:01.259760 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m07:07:01.260400 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m07:07:01.260400 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:07:01.264106 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:07:01.266297 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:07:01.270334 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:07:01.271843 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:07:01.272362 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m07:07:01.273376 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:01.274922 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:01.274922 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:07:01.275449 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m07:07:01.350520 [debug] [Thread-1 (]: SQL status: OK in 0.073 seconds
[0m07:07:01.354307 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:07:01.354916 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m07:07:01.355479 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:01.356491 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m07:07:01.357029 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:07:01.357029 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m07:07:01.473738 [debug] [Thread-1 (]: SQL status: OK in 0.116 seconds
[0m07:07:01.480459 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:07:01.481965 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m07:07:01.484984 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:01.488516 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m07:07:01.489512 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79F5A30>]}
[0m07:07:01.490024 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.23s]
[0m07:07:01.493025 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:07:01.493025 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:07:01.495621 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m07:07:01.497635 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m07:07:01.498889 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:07:01.511183 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:07:01.513708 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:07:01.518847 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:07:01.521879 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:07:01.522934 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m07:07:01.524378 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:01.525476 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:01.527141 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:07:01.529677 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m07:07:02.045561 [debug] [Thread-1 (]: SQL status: OK in 0.516 seconds
[0m07:07:02.048586 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:07:02.048586 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m07:07:02.050252 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.051764 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:07:02.051764 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:07:02.051764 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:07:02.181159 [debug] [Thread-1 (]: SQL status: OK in 0.129 seconds
[0m07:07:02.184262 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:07:02.185263 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m07:07:02.185263 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.187247 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m07:07:02.187769 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA4947770>]}
[0m07:07:02.187769 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.69s]
[0m07:07:02.187769 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:07:02.189423 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:07:02.190465 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m07:07:02.191934 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m07:07:02.192447 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:07:02.194675 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:07:02.196306 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:07:02.200084 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:07:02.201169 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:07:02.201739 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m07:07:02.201739 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.202257 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.202770 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:07:02.202770 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m07:07:02.207231 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:07:02.268990 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:07:02.268990 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m07:07:02.271599 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.275529 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m07:07:02.275529 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:07:02.277147 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m07:07:02.282846 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:07:02.285121 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:07:02.286153 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m07:07:02.286153 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.287673 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m07:07:02.287673 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79C7E00>]}
[0m07:07:02.287673 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.10s]
[0m07:07:02.289209 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:07:02.289209 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:07:02.289787 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m07:07:02.289787 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m07:07:02.289787 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:07:02.292978 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:07:02.293972 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:07:02.295586 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:07:02.296620 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:07:02.296620 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m07:07:02.297602 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.297602 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.297602 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:07:02.298646 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m07:07:02.324313 [debug] [Thread-1 (]: SQL status: OK in 0.026 seconds
[0m07:07:02.326830 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:07:02.326830 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m07:07:02.327837 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.328838 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m07:07:02.328838 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:07:02.328838 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m07:07:02.342094 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m07:07:02.344101 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:07:02.344606 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m07:07:02.344606 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.345612 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m07:07:02.346619 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79A4110>]}
[0m07:07:02.346619 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.06s]
[0m07:07:02.347617 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:07:02.348122 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:07:02.348631 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m07:07:02.348631 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m07:07:02.348631 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:07:02.352420 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:07:02.353013 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:07:02.355664 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:07:02.356726 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:07:02.356726 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m07:07:02.357230 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.357752 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.357752 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:07:02.358280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    md5(cast(cast(d.codigo as bigint) as varchar))
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m07:07:02.610301 [debug] [Thread-1 (]: SQL status: OK in 0.252 seconds
[0m07:07:02.613586 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:07:02.614092 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m07:07:02.614092 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.615641 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m07:07:02.615641 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:07:02.616162 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m07:07:02.778815 [debug] [Thread-1 (]: SQL status: OK in 0.162 seconds
[0m07:07:02.781570 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:07:02.782083 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m07:07:02.783077 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.784799 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m07:07:02.785369 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA7981FD0>]}
[0m07:07:02.785939 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.44s]
[0m07:07:02.787076 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:07:02.787587 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m07:07:02.788118 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m07:07:02.788640 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m07:07:02.789646 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m07:07:02.789646 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m07:07:02.810807 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:07:02.811355 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m07:07:02.811355 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.811931 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.812454 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:07:02.812454 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m07:07:02.813512 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.821970 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:07:02.821970 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.825335 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:02.829707 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:07:02.831498 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m07:07:02.832011 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:07:02.832011 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m07:07:02.839136 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:07:02.839649 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m07:07:02.840225 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA68AD340>]}
[0m07:07:02.840225 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.05s]
[0m07:07:02.840225 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m07:07:02.841739 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:07:02.841739 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m07:07:02.842744 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m07:07:02.842744 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:07:02.842744 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:07:02.846396 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:07:02.847026 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m07:07:02.847539 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.847539 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.848546 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:07:02.848546 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m07:07:02.849052 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.850059 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:07:02.850059 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.852505 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.853109 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:07:02.854620 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:07:02.854620 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:07:02.855627 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:07:02.857638 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.858142 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m07:07:02.858690 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79B6B70>]}
[0m07:07:02.858690 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.02s]
[0m07:07:02.859696 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:07:02.860250 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:07:02.860250 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m07:07:02.861254 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m07:07:02.861254 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:07:02.861254 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:07:02.864845 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:07:02.864845 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m07:07:02.864845 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.864845 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.866797 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:07:02.866797 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m07:07:02.866797 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.867804 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:07:02.867804 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.870311 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.870311 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:07:02.872663 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:07:02.873671 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:07:02.874177 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:07:02.875262 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.876810 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m07:07:02.876810 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79BF380>]}
[0m07:07:02.877817 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.02s]
[0m07:07:02.878541 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:07:02.879549 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:07:02.880063 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m07:07:02.881074 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m07:07:02.881074 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:07:02.881074 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:07:02.884591 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:07:02.884591 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m07:07:02.884591 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.885589 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.885589 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:07:02.885589 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m07:07:02.886588 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.888094 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:07:02.888094 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.889602 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.890611 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:07:02.892118 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:07:02.892118 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:07:02.892118 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:07:02.894259 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.895789 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m07:07:02.895789 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA63B5250>]}
[0m07:07:02.896791 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.02s]
[0m07:07:02.896791 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:07:02.896791 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m07:07:02.897794 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m07:07:02.898303 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m07:07:02.898810 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m07:07:02.898810 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m07:07:02.902517 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:07:02.902517 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m07:07:02.903140 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.903140 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.903140 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:07:02.903140 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m07:07:02.904713 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.905721 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:07:02.905721 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.908416 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.909159 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:07:02.910816 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m07:07:02.910816 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:07:02.910816 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m07:07:02.913329 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.913834 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m07:07:02.913834 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA34952E0>]}
[0m07:07:02.914843 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.02s]
[0m07:07:02.915350 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m07:07:02.915350 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m07:07:02.915350 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m07:07:02.916355 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m07:07:02.916959 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m07:07:02.916959 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m07:07:02.921102 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:07:02.921102 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m07:07:02.921647 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.922214 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.922214 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:07:02.922214 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m07:07:02.922214 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.923749 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:07:02.924448 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.926170 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.926170 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:07:02.928262 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m07:07:02.928262 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:07:02.928262 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m07:07:02.930443 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.930443 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m07:07:02.932027 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA7951F10>]}
[0m07:07:02.932027 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.02s]
[0m07:07:02.933033 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m07:07:02.933033 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m07:07:02.933033 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m07:07:02.934034 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m07:07:02.934034 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m07:07:02.934034 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m07:07:02.937543 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:07:02.937543 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m07:07:02.937543 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.938551 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.938551 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:07:02.938551 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m07:07:02.939552 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.940057 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:07:02.940057 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.942206 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.943213 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:07:02.944718 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m07:07:02.945224 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:07:02.945224 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m07:07:02.946230 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.946230 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m07:07:02.947735 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA7953170>]}
[0m07:07:02.947735 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.01s]
[0m07:07:02.948740 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m07:07:02.948740 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m07:07:02.950372 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m07:07:02.950985 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m07:07:02.950985 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m07:07:02.950985 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m07:07:02.955888 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:07:02.955888 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m07:07:02.956895 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.957401 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.957401 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:07:02.957929 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m07:07:02.957929 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:02.958657 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:07:02.958657 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.960168 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.961174 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:07:02.963239 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m07:07:02.963239 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:07:02.963815 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m07:07:02.964821 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.964821 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m07:07:02.964821 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA63B4200>]}
[0m07:07:02.966460 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.01s]
[0m07:07:02.967007 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m07:07:02.967007 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m07:07:02.968013 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m07:07:02.968549 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m07:07:02.969555 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m07:07:02.969555 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m07:07:02.976727 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:07:02.977726 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m07:07:02.977726 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:02.978727 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.979727 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:07:02.980726 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m07:07:02.982725 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:02.984095 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:07:02.985104 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:02.989891 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:02.991460 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:07:02.993164 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m07:07:02.994673 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:07:02.995685 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m07:07:02.997705 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:02.999223 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m07:07:03.000230 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA62B9CA0>]}
[0m07:07:03.000230 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.03s]
[0m07:07:03.001237 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m07:07:03.001746 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:07:03.002754 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m07:07:03.003370 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m07:07:03.004888 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:07:03.005382 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:07:03.010100 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:07:03.011110 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m07:07:03.011110 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.012617 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.013629 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:07:03.014142 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m07:07:03.014649 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.017130 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:07:03.017640 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:07:03.020654 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:03.021776 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:07:03.024429 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:07:03.025436 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:07:03.025943 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:07:03.027957 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:03.030115 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m07:07:03.031131 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA794E390>]}
[0m07:07:03.031131 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.03s]
[0m07:07:03.033411 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:07:03.033411 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:07:03.034421 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m07:07:03.035420 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m07:07:03.036420 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:07:03.046590 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:07:03.048096 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:07:03.062411 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:07:03.064473 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:07:03.065325 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m07:07:03.066011 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.067120 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.067120 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:07:03.068180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.069179 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.074596 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m07:07:03.076115 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m07:07:03.076115 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m07:07:03.077122 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.04s]
[0m07:07:03.077122 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:07:03.078130 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:07:03.078130 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m07:07:03.078130 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m07:07:03.079637 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:07:03.084308 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:07:03.085310 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:07:03.087813 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:07:03.089446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:07:03.089446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m07:07:03.090460 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.090460 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.091465 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:07:03.091979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.092991 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.093991 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m07:07:03.094501 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m07:07:03.094501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m07:07:03.096152 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m07:07:03.096152 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:07:03.096152 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:07:03.097663 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m07:07:03.097663 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m07:07:03.097663 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:07:03.102700 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:07:03.104000 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:07:03.106043 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:07:03.106548 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:07:03.107662 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m07:07:03.107662 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.108221 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.108221 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:07:03.108221 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:07:03.111419 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:03.112450 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m07:07:03.114055 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m07:07:03.114055 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m07:07:03.114055 [info ] [Thread-1 (]: 24 of 97 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m07:07:03.115058 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:07:03.115058 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:07:03.116064 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m07:07:03.116064 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m07:07:03.116064 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:07:03.119282 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:07:03.120788 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:07:03.122299 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:07:03.122804 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:07:03.122804 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m07:07:03.123810 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.124360 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.124360 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:07:03.124360 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.125368 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.125368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m07:07:03.127102 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m07:07:03.127749 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m07:07:03.127749 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m07:07:03.128753 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:07:03.128753 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:07:03.128753 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m07:07:03.130261 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m07:07:03.130261 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:07:03.133859 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:07:03.134858 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:07:03.135859 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:07:03.137368 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:07:03.137925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m07:07:03.137925 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.137925 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.137925 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:07:03.137925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.140602 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.142142 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m07:07:03.142142 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m07:07:03.142142 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m07:07:03.143790 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.01s]
[0m07:07:03.144307 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:07:03.145316 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:07:03.145316 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m07:07:03.145848 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m07:07:03.146353 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:07:03.149093 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:07:03.150100 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:07:03.154619 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:07:03.156134 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:07:03.156639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m07:07:03.156639 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.157647 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.158154 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:07:03.158154 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:07:03.160905 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:03.162414 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m07:07:03.163442 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m07:07:03.164037 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m07:07:03.164037 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m07:07:03.165548 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:07:03.165548 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:07:03.166587 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m07:07:03.167122 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m07:07:03.167122 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:07:03.170143 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:07:03.171241 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:07:03.173387 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:07:03.174527 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:07:03.174527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m07:07:03.174527 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.175533 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.175533 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:07:03.176167 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.177172 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.178197 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m07:07:03.178197 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m07:07:03.179722 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m07:07:03.180293 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m07:07:03.181300 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:07:03.181300 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:07:03.181300 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m07:07:03.182339 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m07:07:03.182339 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:07:03.185380 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:07:03.186379 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:07:03.187892 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:07:03.189499 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:07:03.189499 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m07:07:03.189499 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.190507 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.191200 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:07:03.191713 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:07:03.193233 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:03.195763 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m07:07:03.196767 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m07:07:03.196767 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m07:07:03.196767 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m07:07:03.197768 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:07:03.199144 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:07:03.200152 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m07:07:03.200657 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m07:07:03.200657 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:07:03.203446 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:07:03.205019 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:07:03.207899 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:07:03.208538 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:07:03.209544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m07:07:03.209544 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.210049 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.210049 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:07:03.210049 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.211056 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.212561 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m07:07:03.212561 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m07:07:03.213568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m07:07:03.214074 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.01s]
[0m07:07:03.214074 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:07:03.215079 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:07:03.215079 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m07:07:03.215079 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m07:07:03.216084 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:07:03.218442 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:07:03.219440 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:07:03.222585 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:07:03.224119 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:07:03.224119 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m07:07:03.224119 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.224650 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.225190 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:07:03.225190 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.225190 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.225190 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m07:07:03.227605 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m07:07:03.227605 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m07:07:03.228609 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m07:07:03.229610 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:07:03.229610 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:07:03.230114 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:07:03.230114 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m07:07:03.230114 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:07:03.236198 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:07:03.236882 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:07:03.238002 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:07:03.239621 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:07:03.239621 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m07:07:03.240635 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.240635 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.241653 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:07:03.241653 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.244189 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:03.245276 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m07:07:03.246393 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m07:07:03.247377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m07:07:03.247883 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:07:03.248392 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:07:03.249397 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:07:03.250402 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:07:03.251292 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m07:07:03.251795 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:07:03.257428 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:07:03.257970 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:07:03.260254 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:07:03.262262 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:07:03.262262 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m07:07:03.262262 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.263266 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.263770 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:07:03.263770 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.273815 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m07:07:03.275325 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m07:07:03.276856 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m07:07:03.277861 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m07:07:03.277861 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:07:03.278862 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:07:03.278862 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:07:03.278862 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m07:07:03.279861 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m07:07:03.279861 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:07:03.283876 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:07:03.284875 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:07:03.285876 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:07:03.287379 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:07:03.287379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m07:07:03.287379 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.287918 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.287918 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:07:03.287918 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.290103 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.290696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m07:07:03.292202 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m07:07:03.292202 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m07:07:03.292801 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.01s]
[0m07:07:03.293395 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:07:03.293991 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:07:03.293991 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m07:07:03.294499 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m07:07:03.295099 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:07:03.298841 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:07:03.299935 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:07:03.302336 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:07:03.303372 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:07:03.303372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m07:07:03.304376 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.304879 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.305393 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:07:03.305393 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.306506 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.307678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m07:07:03.308414 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m07:07:03.309137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m07:07:03.309680 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m07:07:03.310336 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:07:03.310336 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:07:03.311343 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:07:03.312344 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m07:07:03.312344 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:07:03.316093 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:07:03.317181 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:07:03.321210 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:07:03.321868 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:07:03.322555 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m07:07:03.322555 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.323574 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.324297 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:07:03.325307 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.329559 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:03.332539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m07:07:03.335223 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m07:07:03.336224 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m07:07:03.338897 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:07:03.340451 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:07:03.341965 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:07:03.341965 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:07:03.342974 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m07:07:03.342974 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:07:03.349013 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:07:03.350610 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:07:03.353334 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:07:03.354909 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:07:03.354909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m07:07:03.355614 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.355614 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.355614 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:07:03.356621 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.360523 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:07:03.362543 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m07:07:03.362543 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m07:07:03.363633 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m07:07:03.363633 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:07:03.364644 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:07:03.365185 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:07:03.365185 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m07:07:03.366205 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m07:07:03.366205 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:07:03.369615 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:07:03.371122 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:07:03.372241 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:07:03.374365 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:07:03.374996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m07:07:03.375600 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.376758 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.377287 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:07:03.377287 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.377932 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.379192 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m07:07:03.380239 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m07:07:03.380807 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m07:07:03.381946 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.02s]
[0m07:07:03.382528 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:07:03.383098 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:07:03.383098 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m07:07:03.383720 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m07:07:03.384733 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:07:03.387807 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:07:03.387807 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:07:03.390556 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:07:03.391567 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:07:03.393246 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m07:07:03.394924 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.396015 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.396645 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:07:03.397291 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.398402 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.399578 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m07:07:03.401205 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m07:07:03.401747 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m07:07:03.403273 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m07:07:03.403273 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:07:03.404131 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:07:03.404131 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:07:03.404660 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m07:07:03.405385 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:07:03.410082 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:07:03.411107 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:07:03.413182 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:07:03.413741 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:07:03.414759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m07:07:03.414759 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.416424 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.416424 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:07:03.417011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.419026 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:03.419026 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m07:07:03.420533 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m07:07:03.421201 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m07:07:03.421900 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:07:03.422428 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:07:03.422951 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:07:03.423477 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:07:03.423477 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m07:07:03.423477 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:07:03.427967 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:07:03.428969 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:07:03.432831 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:07:03.433814 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:07:03.434815 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m07:07:03.434815 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.435827 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.437335 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:07:03.438059 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.445919 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m07:07:03.449985 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m07:07:03.450536 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m07:07:03.451096 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m07:07:03.451096 [info ] [Thread-1 (]: 41 of 97 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:07:03.452109 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:07:03.452109 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:07:03.452616 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m07:07:03.453220 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m07:07:03.453793 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:07:03.457568 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:07:03.458578 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:07:03.461171 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:07:03.461171 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:07:03.462680 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m07:07:03.463251 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.463798 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.463798 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:07:03.464914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.466103 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.467616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m07:07:03.467616 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m07:07:03.468623 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m07:07:03.469306 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.02s]
[0m07:07:03.469306 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:07:03.470316 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:07:03.470824 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m07:07:03.471330 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m07:07:03.471330 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:07:03.473859 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:07:03.474981 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:07:03.477321 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:07:03.478329 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:07:03.478329 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m07:07:03.478329 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.479844 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.479844 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:07:03.479844 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.480962 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.481955 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m07:07:03.482518 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m07:07:03.482518 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m07:07:03.483521 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.01s]
[0m07:07:03.484568 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:07:03.485183 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:07:03.485183 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:07:03.485183 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m07:07:03.486192 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:07:03.489709 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:07:03.490261 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:07:03.492778 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:07:03.496017 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:07:03.496017 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m07:07:03.497632 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.499157 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.499157 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:07:03.499157 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.502845 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:03.504395 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m07:07:03.505405 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m07:07:03.505914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m07:07:03.506425 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:07:03.506425 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:07:03.506425 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:07:03.507431 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:07:03.507936 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m07:07:03.507936 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:07:03.511084 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:07:03.512593 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:07:03.514616 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:07:03.516286 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:07:03.516286 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m07:07:03.517539 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.518070 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.518070 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:07:03.519079 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.522237 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:03.523799 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m07:07:03.524806 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m07:07:03.525311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m07:07:03.525311 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:07:03.525311 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:07:03.526858 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:07:03.526858 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m07:07:03.527864 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m07:07:03.527864 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:07:03.532613 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:07:03.533621 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:07:03.534720 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:07:03.535722 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:07:03.535722 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m07:07:03.535722 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.537342 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.537342 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:07:03.537342 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.537892 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.539539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m07:07:03.540547 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m07:07:03.540547 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m07:07:03.541544 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m07:07:03.542046 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:07:03.542046 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:07:03.542046 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m07:07:03.543049 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m07:07:03.543049 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:07:03.546565 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:07:03.548180 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:07:03.551375 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:07:03.552542 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:07:03.552542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m07:07:03.553236 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.553236 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.553236 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:07:03.554243 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.554748 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.555316 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m07:07:03.556933 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m07:07:03.556933 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m07:07:03.557649 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m07:07:03.557649 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:07:03.558713 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:07:03.558713 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:07:03.558713 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m07:07:03.558713 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:07:03.563557 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:07:03.564064 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:07:03.566083 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:07:03.567089 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:07:03.568279 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m07:07:03.568279 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.568279 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.568279 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:07:03.569391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.572921 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:03.573427 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m07:07:03.575062 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m07:07:03.575062 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m07:07:03.575062 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:07:03.576181 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:07:03.576181 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:07:03.577067 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:07:03.577067 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m07:07:03.577067 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:07:03.582148 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:07:03.583196 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:07:03.584193 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:07:03.585192 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:07:03.586177 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m07:07:03.586177 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.586177 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.587179 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:07:03.587179 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.592291 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:07:03.592797 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m07:07:03.594317 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m07:07:03.594956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m07:07:03.595474 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:07:03.596481 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:07:03.596481 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:07:03.596481 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m07:07:03.597511 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m07:07:03.598015 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:07:03.600903 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:07:03.601910 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:07:03.604931 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:07:03.605444 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:07:03.606450 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m07:07:03.606450 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.606955 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.607460 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:07:03.607460 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.608465 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.610272 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m07:07:03.611386 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m07:07:03.611386 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m07:07:03.612385 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m07:07:03.612385 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:07:03.612385 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:07:03.613557 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m07:07:03.613557 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m07:07:03.613557 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:07:03.617214 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:07:03.618223 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:07:03.620265 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:07:03.621440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:07:03.622533 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m07:07:03.622533 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.622533 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.623541 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:07:03.624646 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.626167 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.627186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m07:07:03.628193 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m07:07:03.628699 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m07:07:03.629712 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m07:07:03.630294 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:07:03.631856 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:07:03.632866 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:07:03.633864 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m07:07:03.633864 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:07:03.637861 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:07:03.639492 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:07:03.642027 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:07:03.643554 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:07:03.644076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m07:07:03.644076 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.644076 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.645634 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:07:03.645634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.646646 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.648155 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m07:07:03.648662 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m07:07:03.648662 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m07:07:03.648662 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:07:03.650819 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:07:03.650819 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:07:03.650819 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:07:03.651827 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m07:07:03.651827 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:07:03.656355 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:07:03.657597 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:07:03.659979 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:07:03.661011 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:07:03.661011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m07:07:03.661011 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.661994 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.662499 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:07:03.662499 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.664109 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.664639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m07:07:03.666317 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m07:07:03.666903 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m07:07:03.666903 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:07:03.667908 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:07:03.667908 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:07:03.667908 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m07:07:03.668907 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m07:07:03.668907 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:07:03.671444 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:07:03.673644 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:07:03.675371 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:07:03.675371 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:07:03.675371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m07:07:03.675371 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.676940 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.676940 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:07:03.676940 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.677946 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.679947 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m07:07:03.680452 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m07:07:03.680452 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m07:07:03.680452 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m07:07:03.681958 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:07:03.681958 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:07:03.681958 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m07:07:03.682963 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m07:07:03.683466 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:07:03.686502 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:07:03.687470 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:07:03.690653 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:07:03.691639 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:07:03.692143 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m07:07:03.692143 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.693148 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.693148 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:07:03.694167 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.694167 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.695964 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m07:07:03.695964 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m07:07:03.695964 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m07:07:03.695964 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m07:07:03.697566 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:07:03.697566 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:07:03.697566 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:07:03.699302 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m07:07:03.699302 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:07:03.703243 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:07:03.703243 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:07:03.706183 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:07:03.707699 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:07:03.708205 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m07:07:03.708205 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.709844 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.709844 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:07:03.709844 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.712355 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:03.713867 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m07:07:03.714971 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m07:07:03.715507 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m07:07:03.716049 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:07:03.716049 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:07:03.716049 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:07:03.717062 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:07:03.717062 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m07:07:03.717062 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:07:03.722322 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:07:03.723355 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:07:03.725507 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:07:03.726644 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:07:03.726644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m07:07:03.727156 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.728249 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.728249 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:07:03.728772 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.731838 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:03.732861 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m07:07:03.733842 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m07:07:03.733842 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m07:07:03.734843 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:07:03.734843 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:07:03.734843 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:07:03.735843 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m07:07:03.736477 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m07:07:03.736477 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:07:03.739543 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:07:03.740554 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:07:03.743067 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:07:03.744066 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:07:03.744066 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m07:07:03.744570 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.744570 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.744570 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:07:03.745601 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.745601 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.747615 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m07:07:03.748120 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m07:07:03.748624 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m07:07:03.748624 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m07:07:03.748624 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:07:03.750159 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:07:03.750159 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m07:07:03.750761 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m07:07:03.751299 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:07:03.754016 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:07:03.755244 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:07:03.756999 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:07:03.757623 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:07:03.757623 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m07:07:03.757623 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.758977 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.759533 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:07:03.760076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.761087 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.761087 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m07:07:03.762595 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m07:07:03.762595 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m07:07:03.763601 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m07:07:03.764105 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:07:03.764105 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:07:03.765110 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:07:03.765110 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m07:07:03.765110 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:07:03.770284 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:07:03.771315 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:07:03.773408 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:07:03.774414 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:07:03.774921 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m07:07:03.775427 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.775427 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.775427 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:07:03.775427 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.779564 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:03.781174 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m07:07:03.781174 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m07:07:03.782145 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m07:07:03.782145 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:07:03.783494 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:07:03.784175 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:07:03.784175 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:07:03.784175 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m07:07:03.785181 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:07:03.788695 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:07:03.789695 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:07:03.791405 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:07:03.795574 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:07:03.795574 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m07:07:03.796580 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.796580 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.796580 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:07:03.797605 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:03.806624 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m07:07:03.807644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m07:07:03.808244 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m07:07:03.808244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m07:07:03.808244 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:07:03.808244 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:07:03.810659 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m07:07:03.811667 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m07:07:03.812664 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m07:07:03.812664 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m07:07:03.815025 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m07:07:03.816226 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m07:07:03.819284 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m07:07:03.820815 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:07:03.821430 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m07:07:03.821430 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.821430 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.822434 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:07:03.822434 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m07:07:03.823443 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.825560 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:07:03.825560 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m07:07:03.827135 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.828158 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m07:07:03.828158 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:07:03.828158 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m07:07:03.831984 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:07:03.834041 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:07:03.834041 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m07:07:03.834041 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.835025 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m07:07:03.836042 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA7A20170>]}
[0m07:07:03.836042 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.02s]
[0m07:07:03.836042 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m07:07:03.837551 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:07:03.837551 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m07:07:03.838558 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m07:07:03.838558 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:07:03.840126 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:07:03.842209 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:07:03.845466 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:07:03.847558 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:07:03.847558 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m07:07:03.848590 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:03.848590 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.848590 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:07:03.848590 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m07:07:03.850968 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:03.852923 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:07:03.852923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m07:07:03.852923 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.854478 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:07:03.854478 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:07:03.855489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:07:03.859731 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:07:03.862000 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:07:03.862000 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m07:07:03.862516 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:03.863537 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m07:07:03.864148 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA7A17FE0>]}
[0m07:07:04.768036 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m07:07:04.775337 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.03s]
[0m07:07:04.777357 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:07:04.777357 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:07:04.778451 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m07:07:04.780290 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m07:07:04.780973 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m07:07:04.784259 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:07:04.786258 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m07:07:04.787765 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:07:04.789434 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:07:04.789434 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m07:07:04.790440 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.790945 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.790945 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:07:04.791450 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m07:07:04.792026 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.794032 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:07:04.794538 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m07:07:04.794538 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.795544 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:07:04.796550 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:07:04.796550 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:07:04.801210 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:07:04.803315 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:07:04.803315 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m07:07:04.804371 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.805410 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m07:07:04.805963 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA63C5BB0>]}
[0m07:07:04.805963 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m07:07:04.806506 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:07:04.806506 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m07:07:04.806506 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m07:07:04.807631 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m07:07:04.808260 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m07:07:04.810045 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:07:04.811054 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m07:07:04.814085 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:07:04.815090 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:07:04.816097 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m07:07:04.816097 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.817107 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:04.817107 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:07:04.818116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m07:07:04.820129 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:04.823952 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:07:04.824568 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m07:07:04.825575 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.825575 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:07:04.825575 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:07:04.827178 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:07:04.832025 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:07:04.834043 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:07:04.835042 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m07:07:04.835042 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.836042 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m07:07:04.836042 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA63FA900>]}
[0m07:07:04.837549 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m07:07:04.838555 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m07:07:04.838555 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:07:04.838555 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m07:07:04.839556 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m07:07:04.839556 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:07:04.842350 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:07:04.842350 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:07:04.845599 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:07:04.846104 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:07:04.846104 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m07:07:04.846104 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.847610 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.847610 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:07:04.847610 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m07:07:04.848618 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.850794 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:07:04.850794 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m07:07:04.851800 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.852823 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m07:07:04.853388 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:07:04.853388 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m07:07:04.855516 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:04.856548 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:07:04.856548 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m07:07:04.857617 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.859313 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m07:07:04.859816 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA6935850>]}
[0m07:07:04.859816 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.02s]
[0m07:07:04.860822 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:07:04.860822 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m07:07:04.860822 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m07:07:04.862326 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m07:07:04.862326 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m07:07:04.863974 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m07:07:04.865012 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m07:07:04.868393 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m07:07:04.869393 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:07:04.869393 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m07:07:04.869393 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.870378 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.870378 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:07:04.870378 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m07:07:04.871416 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.874016 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:07:04.874552 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m07:07:04.874552 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.877091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m07:07:04.877091 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:07:04.877091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m07:07:04.879618 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:04.882204 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:07:04.883303 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m07:07:04.883303 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.884302 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m07:07:04.884302 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBC57F25D0>]}
[0m07:07:04.885319 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.02s]
[0m07:07:04.885319 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m07:07:04.886302 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:07:04.886302 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m07:07:04.887811 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m07:07:04.887811 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:07:04.890439 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:07:04.892045 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:07:04.894564 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:07:04.895569 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:07:04.895569 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m07:07:04.896599 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.896599 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:04.896599 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:07:04.897591 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m07:07:04.897591 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:04.900389 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:07:04.900920 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m07:07:04.900920 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.903096 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m07:07:04.903096 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:07:04.903096 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m07:07:04.904689 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:04.907281 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:07:04.907281 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m07:07:04.908403 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.909455 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m07:07:04.909965 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA6298200>]}
[0m07:07:04.909965 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m07:07:04.910972 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:07:04.910972 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m07:07:04.910972 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m07:07:04.912478 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m07:07:04.912478 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m07:07:04.914997 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m07:07:04.916074 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m07:07:04.918593 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m07:07:04.918593 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:07:04.918593 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m07:07:04.920099 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.920685 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.921198 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:07:04.921198 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m07:07:04.922288 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.924301 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:07:04.924301 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m07:07:04.925307 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.925812 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m07:07:04.925812 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:07:04.926819 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m07:07:04.928826 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:04.930395 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:07:04.930395 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m07:07:04.930395 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.932988 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m07:07:04.932988 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA610CA10>]}
[0m07:07:04.933906 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m07:07:04.934908 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m07:07:04.934908 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m07:07:04.935908 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m07:07:04.935908 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m07:07:04.935908 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m07:07:04.939656 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m07:07:04.940689 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m07:07:04.942798 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m07:07:04.944332 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:07:04.944332 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m07:07:04.944332 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.945367 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.945367 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:07:04.945367 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m07:07:04.946469 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.948591 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:07:04.948591 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m07:07:04.948591 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.950725 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m07:07:04.950725 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:07:04.951402 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m07:07:04.953122 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:04.954648 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:07:04.954648 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m07:07:04.955655 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.956927 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m07:07:04.957484 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA68A4C80>]}
[0m07:07:04.957484 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m07:07:04.958301 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m07:07:04.958301 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m07:07:04.959307 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m07:07:04.959812 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m07:07:04.959812 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m07:07:04.961341 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:07:04.962355 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m07:07:04.964702 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:07:04.967090 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:07:04.967090 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m07:07:04.967090 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.968098 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.968098 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:07:04.968098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m07:07:04.969097 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.971850 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:07:04.971850 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m07:07:04.972382 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.973390 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:07:04.973896 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:07:04.973896 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:07:04.975405 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:04.977930 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:07:04.977930 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m07:07:04.977930 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.980062 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m07:07:04.980062 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79E41A0>]}
[0m07:07:04.980062 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m07:07:04.981069 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m07:07:04.981069 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:07:04.982073 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m07:07:04.982073 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m07:07:04.982073 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:07:04.985103 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:07:04.986080 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:07:04.989633 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:07:04.990799 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:07:04.990799 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m07:07:04.990799 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:04.991800 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:04.991800 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:07:04.992877 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m07:07:04.992877 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:04.994401 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m07:07:04.995430 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m07:07:04.995430 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m07:07:04.995963 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m07:07:04.995963 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:07:04.995963 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:07:04.997468 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m07:07:04.998475 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m07:07:04.998475 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:07:05.002909 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:07:05.003918 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:07:05.007945 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:07:05.008546 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:07:05.008546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m07:07:05.008546 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.009684 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:05.010318 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:07:05.010318 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:05.012324 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.013880 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m07:07:05.014886 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m07:07:05.014886 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m07:07:05.015391 [info ] [Thread-1 (]: 73 of 97 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:07:05.015391 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:07:05.016397 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:07:05.016397 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m07:07:05.016928 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m07:07:05.016928 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:07:05.020439 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:07:05.021013 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:07:05.022283 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:07:05.023818 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:07:05.023818 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m07:07:05.024458 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.024458 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:05.024458 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:07:05.024458 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:07:05.027067 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.028090 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m07:07:05.030234 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m07:07:05.030234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m07:07:05.030234 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.01s]
[0m07:07:05.031237 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:07:05.031237 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:07:05.032238 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m07:07:05.032238 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m07:07:05.033403 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:07:05.035824 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:07:05.037348 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:07:05.037933 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:07:05.039569 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:07:05.040577 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m07:07:05.040577 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.041578 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.042086 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:07:05.042086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m07:07:05.043095 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:05.044095 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m07:07:05.044095 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m07:07:05.044095 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m07:07:05.045989 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m07:07:05.045989 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:07:05.047701 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:07:05.047701 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m07:07:05.048708 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m07:07:05.048708 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:07:05.053111 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:07:05.053111 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:07:05.055339 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:07:05.056893 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:07:05.057416 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m07:07:05.057416 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.057980 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:05.057980 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:07:05.058594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:05.060319 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.062339 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m07:07:05.062339 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m07:07:05.062339 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m07:07:05.063613 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m07:07:05.063613 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:07:05.063613 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:07:05.065071 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m07:07:05.065071 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m07:07:05.065071 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:07:05.070312 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:07:05.070312 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:07:05.072272 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:07:05.073817 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:07:05.074403 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m07:07:05.074403 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.075411 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.075411 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:07:05.077239 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:07:05.078247 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.078247 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m07:07:05.079772 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m07:07:05.080484 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m07:07:05.080484 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m07:07:05.082139 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:07:05.082139 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:07:05.082139 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m07:07:05.083145 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m07:07:05.083145 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:07:05.086159 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:07:05.087156 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:07:05.087684 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:07:05.089842 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:07:05.089842 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m07:07:05.089842 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.089842 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:05.091415 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:07:05.092163 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m07:07:05.092163 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:05.093170 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m07:07:05.094675 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m07:07:05.095179 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m07:07:05.095179 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m07:07:05.096186 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:07:05.096186 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:07:05.096186 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m07:07:05.097690 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m07:07:05.097690 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:07:05.101870 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:07:05.102929 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:07:05.104495 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:07:05.105523 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:07:05.105523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m07:07:05.105523 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.106596 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.106596 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:07:05.106596 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:05.108631 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.110144 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m07:07:05.111151 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m07:07:05.111151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m07:07:05.111151 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m07:07:05.112151 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:07:05.112151 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:07:05.112151 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m07:07:05.113343 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m07:07:05.113882 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:07:05.117064 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:07:05.118077 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:07:05.119100 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:07:05.120637 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:07:05.120637 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m07:07:05.121240 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.121240 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:05.121797 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:07:05.122463 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:07:05.123975 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:05.124502 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m07:07:05.126014 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m07:07:05.126014 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m07:07:05.127020 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m07:07:05.127537 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:07:05.127537 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:07:05.127537 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m07:07:05.128542 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m07:07:05.128542 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:07:05.132052 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:07:05.133201 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:07:05.137695 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:07:05.138200 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:07:05.139732 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m07:07:05.139732 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:05.139732 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:05.139732 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:07:05.139732 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:07:12.585422 [debug] [Thread-1 (]: SQL status: OK in 7.444 seconds
[0m07:07:12.588254 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:07:12.588254 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m07:07:12.588254 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:12.589764 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m07:07:12.589764 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:07:12.589764 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m07:07:12.752533 [debug] [Thread-1 (]: SQL status: OK in 0.162 seconds
[0m07:07:12.756119 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:07:12.756864 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m07:07:12.758060 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:12.759650 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m07:07:12.760266 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBC585F8C0>]}
[0m07:07:12.760266 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 7.63s]
[0m07:07:12.761295 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:07:12.763999 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:07:12.765005 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m07:07:12.765005 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m07:07:12.765005 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:07:12.770722 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:07:12.771541 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:07:12.774720 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:07:12.775738 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:07:12.775738 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m07:07:12.775738 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:12.777303 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:12.777303 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:07:12.778334 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:07:12.948629 [debug] [Thread-1 (]: SQL status: OK in 0.170 seconds
[0m07:07:12.951280 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:07:12.951280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m07:07:12.951785 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:12.953116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m07:07:12.953116 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:07:12.953116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m07:07:12.962630 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m07:07:12.965146 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:07:12.965146 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m07:07:12.966152 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:12.967213 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m07:07:12.967213 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79DE660>]}
[0m07:07:12.967213 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.20s]
[0m07:07:12.968569 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:07:12.968569 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:07:12.969598 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m07:07:12.969598 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m07:07:12.970577 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:07:12.974411 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:07:12.974411 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:07:12.977091 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:07:12.978104 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:07:12.978104 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m07:07:12.978104 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:12.979608 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:12.979608 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:07:12.980338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m07:07:23.825261 [debug] [Thread-1 (]: SQL status: OK in 10.844 seconds
[0m07:07:23.827903 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:07:23.827903 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m07:07:23.830232 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:23.831350 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m07:07:23.831350 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:07:23.831969 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m07:07:23.884749 [debug] [Thread-1 (]: SQL status: OK in 0.052 seconds
[0m07:07:23.887887 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:07:23.887887 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m07:07:23.887887 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:23.890648 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m07:07:23.891647 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA7949700>]}
[0m07:07:23.892155 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 10.92s]
[0m07:07:23.893165 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:07:23.893165 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:07:23.894164 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m07:07:23.894164 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m07:07:23.894164 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:07:23.898849 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:07:23.901936 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:07:23.905655 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:07:23.907166 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:07:23.907671 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m07:07:23.908041 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:23.908547 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:23.908874 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:07:23.909552 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:07:24.120665 [debug] [Thread-1 (]: SQL status: OK in 0.211 seconds
[0m07:07:24.122882 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:07:24.122882 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m07:07:24.123906 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.123906 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m07:07:24.125098 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:07:24.125098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m07:07:24.145559 [debug] [Thread-1 (]: SQL status: OK in 0.020 seconds
[0m07:07:24.148439 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:07:24.149030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m07:07:24.149030 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.150653 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m07:07:24.151202 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA79B6210>]}
[0m07:07:24.151743 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.26s]
[0m07:07:24.151743 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:07:24.152772 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:07:24.153481 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m07:07:24.154077 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m07:07:24.154663 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:07:24.157838 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:07:24.159553 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:07:24.162574 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:07:24.163901 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:07:24.163901 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m07:07:24.163901 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.164906 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.164906 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:07:24.164906 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:07:24.463559 [debug] [Thread-1 (]: SQL status: OK in 0.298 seconds
[0m07:07:24.466073 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:07:24.466073 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m07:07:24.466577 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.467081 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m07:07:24.468089 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:07:24.468089 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m07:07:24.519303 [debug] [Thread-1 (]: SQL status: OK in 0.051 seconds
[0m07:07:24.522362 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:07:24.522362 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m07:07:24.524036 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.524732 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m07:07:24.525402 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1775fe0e-0ecd-4ae9-919b-b20f496ee701', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBC5881430>]}
[0m07:07:24.525402 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.37s]
[0m07:07:24.526938 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:07:24.526938 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:07:24.527945 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m07:07:24.528436 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m07:07:24.528436 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:07:24.532008 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:07:24.533126 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:07:24.534090 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:07:24.535115 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:07:24.535115 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m07:07:24.536058 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.536481 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:24.536987 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:07:24.537545 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.537545 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.538672 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m07:07:24.539667 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m07:07:24.539667 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m07:07:24.539667 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m07:07:24.542062 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:07:24.542062 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:07:24.542062 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m07:07:24.543068 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m07:07:24.543068 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:07:24.548174 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:07:24.548678 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:07:24.550655 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:07:24.552277 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:07:24.552277 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m07:07:24.554035 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.556339 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:24.556339 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:07:24.556339 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.558145 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:24.559292 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m07:07:24.560305 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m07:07:24.560305 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m07:07:24.561642 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m07:07:24.563147 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:07:24.563703 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:07:24.563703 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m07:07:24.564711 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m07:07:24.565213 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:07:24.571248 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:07:24.571985 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:07:24.574861 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:07:24.575611 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:07:24.575611 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m07:07:24.575611 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.577375 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:24.578402 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:07:24.578402 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:07:24.580916 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:24.581918 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m07:07:24.583045 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m07:07:24.584053 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m07:07:24.585054 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m07:07:24.586052 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:07:24.586052 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:07:24.587558 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m07:07:24.587558 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m07:07:24.588564 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:07:24.591649 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:07:24.592447 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:07:24.593983 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:07:24.593983 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:07:24.593983 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m07:07:24.595663 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.595663 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.595663 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:07:24.595663 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.596690 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.598685 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m07:07:24.598685 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m07:07:24.598685 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m07:07:24.598685 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m07:07:24.600925 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:07:24.600925 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:07:24.600925 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m07:07:24.600925 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m07:07:24.600925 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:07:24.605085 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:07:24.605769 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:07:24.608167 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:07:24.609907 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:07:24.609907 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m07:07:24.609907 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.610922 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.610922 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:07:24.610922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.612439 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.613461 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m07:07:24.614490 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m07:07:24.614490 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m07:07:24.615001 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m07:07:24.616008 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:07:24.616008 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:07:24.616008 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m07:07:24.617032 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m07:07:24.617032 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:07:24.620579 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:07:24.621516 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:07:24.623296 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:07:24.623822 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:07:24.623822 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m07:07:24.624928 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.625528 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:24.625528 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:07:24.625528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.627053 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:24.628061 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m07:07:24.629572 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m07:07:24.629572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m07:07:24.630824 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.01s]
[0m07:07:24.631831 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:07:24.632337 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:07:24.632337 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m07:07:24.633345 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m07:07:24.634342 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:07:24.637342 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:07:24.637844 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:07:24.640356 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:07:24.641363 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:07:24.641925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m07:07:24.641925 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.642931 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:24.642931 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:07:24.644438 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.644438 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.646963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m07:07:24.647961 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m07:07:24.648466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m07:07:24.648466 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.02s]
[0m07:07:24.648466 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:07:24.650005 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:07:24.650546 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m07:07:24.651131 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m07:07:24.651131 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:07:24.656916 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:07:24.657985 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:07:24.659560 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:07:24.661454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:07:24.661959 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m07:07:24.662470 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.663985 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:07:24.664993 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:07:24.664993 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.664993 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:07:24.666922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m07:07:24.668928 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m07:07:24.668928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m07:07:24.670435 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.02s]
[0m07:07:24.670435 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:07:24.670435 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:07:24.671444 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m07:07:24.671444 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m07:07:24.671444 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:07:24.675237 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:07:24.675237 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:07:24.677452 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:07:24.678475 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:07:24.678475 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m07:07:24.678475 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.678475 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.678475 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:07:24.680002 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.680002 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.681015 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m07:07:24.682036 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m07:07:24.682036 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m07:07:24.683140 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.01s]
[0m07:07:24.683140 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:07:24.684123 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:07:24.684123 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m07:07:24.684123 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m07:07:24.685127 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:07:24.690162 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:07:24.691667 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:07:24.694221 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:07:24.694723 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:07:24.694723 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m07:07:24.695726 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.695726 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.695726 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:07:24.696729 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.700431 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:07:24.702049 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m07:07:24.702551 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m07:07:24.703221 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m07:07:24.703221 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m07:07:24.703221 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:07:24.703221 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:07:24.703221 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m07:07:24.705671 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m07:07:24.705671 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:07:24.708916 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:07:24.709923 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:07:24.710936 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:07:24.712454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:07:24.712454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m07:07:24.713462 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.713968 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.713968 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:07:24.713968 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.714975 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.716390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m07:07:24.717127 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m07:07:24.717127 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m07:07:24.717127 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.01s]
[0m07:07:24.718133 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:07:24.718133 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:07:24.719133 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m07:07:24.719133 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m07:07:24.719133 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:07:24.723336 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:07:24.724344 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:07:24.725347 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:07:24.725347 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:07:24.727028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m07:07:24.727028 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:07:24.728033 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.728033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:07:24.728033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m07:07:24.728563 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:07:24.730134 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m07:07:24.731137 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m07:07:24.731137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m07:07:24.731137 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m07:07:24.732142 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:07:24.733313 [debug] [MainThread]: Using duckdb connection "master"
[0m07:07:24.733313 [debug] [MainThread]: On master: BEGIN
[0m07:07:24.734314 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m07:07:24.734314 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:07:24.734314 [debug] [MainThread]: On master: COMMIT
[0m07:07:24.734314 [debug] [MainThread]: Using duckdb connection "master"
[0m07:07:24.735314 [debug] [MainThread]: On master: COMMIT
[0m07:07:24.735314 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:07:24.735314 [debug] [MainThread]: On master: Close
[0m07:07:24.736314 [debug] [MainThread]: Connection 'master' was properly closed.
[0m07:07:24.736314 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m07:07:24.736314 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m07:07:24.736314 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m07:07:24.736314 [info ] [MainThread]: 
[0m07:07:24.737313 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 25.83 seconds (25.83s).
[0m07:07:24.745168 [debug] [MainThread]: Command end result
[0m07:07:24.780074 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:07:24.782088 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:07:24.789603 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m07:07:24.789603 [info ] [MainThread]: 
[0m07:07:24.790107 [info ] [MainThread]: [32mCompleted successfully[0m
[0m07:07:24.790107 [info ] [MainThread]: 
[0m07:07:24.790107 [info ] [MainThread]: Done. PASS=97 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=97
[0m07:07:24.791611 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 21 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m07:07:24.792149 [debug] [MainThread]: Command `dbt build` succeeded at 07:07:24.792149 after 27.44 seconds
[0m07:07:24.792149 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA4031F70>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA4032BA0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DBA4344CE0>]}
[0m07:07:24.792149 [debug] [MainThread]: Flushing usage events
[0m07:07:25.610198 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m07:28:01.434061 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFB151940>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFE217920>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFA8422A0>]}


============================== 07:28:01.439608 | 86387a38-ca01-4e29-af60-dca31c6782bb ==============================
[0m07:28:01.439608 [info ] [MainThread]: Running with dbt=1.11.5
[0m07:28:01.440614 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'indirect_selection': 'eager', 'invocation_command': 'dbt build', 'use_colors': 'True', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m07:28:01.637878 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFF9D3FE0>]}
[0m07:28:01.687565 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFF7C3D10>]}
[0m07:28:01.689690 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m07:28:01.896322 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m07:28:02.097425 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
[0m07:28:02.097931 [debug] [MainThread]: Nothing changed, skipping partial parsing.
[0m07:28:02.097931 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing
[0m07:28:02.103362 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m07:28:02.140494 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFFF43BF0>]}
[0m07:28:02.215263 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:28:02.217405 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:28:02.323616 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFFDF38C0>]}
[0m07:28:02.324122 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m07:28:02.329799 [info ] [MainThread]: 
[0m07:28:02.330347 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m07:28:02.330347 [info ] [MainThread]: 
[0m07:28:02.331352 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m07:28:02.337693 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m07:28:02.409609 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m07:28:02.409609 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m07:28:02.410114 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:28:02.857534 [debug] [ThreadPool]: SQL status: OK in 0.447 seconds
[0m07:28:02.859136 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m07:28:02.860750 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m07:28:02.861292 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m07:28:02.868914 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:28:02.869469 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m07:28:02.870579 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m07:28:02.871104 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m07:28:02.873703 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:28:02.873703 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m07:28:02.874237 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:28:02.874237 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:28:02.874791 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m07:28:02.875312 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:28:02.875844 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:28:02.876361 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:28:02.876361 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:28:02.876882 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:28:02.876882 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m07:28:02.880094 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m07:28:02.883228 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:28:02.884226 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m07:28:02.884226 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:28:02.884226 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:28:02.885226 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:28:02.885226 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m07:28:02.896220 [debug] [ThreadPool]: SQL status: OK in 0.011 seconds
[0m07:28:02.896220 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m07:28:02.898794 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m07:28:02.898794 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m07:28:02.898794 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D80282270>]}
[0m07:28:02.900243 [debug] [MainThread]: Using duckdb connection "master"
[0m07:28:02.900243 [debug] [MainThread]: On master: BEGIN
[0m07:28:02.901248 [debug] [MainThread]: Opening a new connection, currently in state init
[0m07:28:02.901248 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m07:28:02.901248 [debug] [MainThread]: On master: COMMIT
[0m07:28:02.901248 [debug] [MainThread]: Using duckdb connection "master"
[0m07:28:02.901248 [debug] [MainThread]: On master: COMMIT
[0m07:28:02.902793 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:28:02.902793 [debug] [MainThread]: On master: Close
[0m07:28:02.906516 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:28:02.907631 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m07:28:02.908190 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m07:28:02.909194 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m07:28:02.921393 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:28:02.922754 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m07:28:02.948426 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:28:02.950948 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:28:02.950948 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m07:28:02.950948 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m07:28:02.950948 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:02.950948 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:28:02.952509 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    md5(cast(cast(codigo_origem as bigint) as varchar))
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
QUALIFY row_number() OVER (PARTITION BY codigo_origem ORDER BY tipo_instituicao) = 1
    );
  
  
[0m07:28:03.387902 [debug] [Thread-1 (]: SQL status: OK in 0.434 seconds
[0m07:28:03.393116 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:28:03.393116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m07:28:03.394115 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:03.403084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:28:03.403084 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:28:03.404103 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:28:03.413672 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m07:28:03.419280 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:28:03.419280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m07:28:03.420784 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:03.422295 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m07:28:03.424131 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D80399A60>]}
[0m07:28:03.425594 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.51s]
[0m07:28:03.425594 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:28:03.427128 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:28:03.427128 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m07:28:03.428145 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m07:28:03.428145 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m07:28:03.432862 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:28:03.433861 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m07:28:03.436414 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:28:03.437443 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:28:03.438120 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m07:28:03.438120 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:03.438120 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:03.439720 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:28:03.439720 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m07:28:03.504365 [debug] [Thread-1 (]: SQL status: OK in 0.064 seconds
[0m07:28:03.508638 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:28:03.508638 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m07:28:03.510171 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:03.512273 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:28:03.512273 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:28:03.513295 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:28:03.520150 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:28:03.522331 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:28:03.523951 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m07:28:03.525562 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:03.527209 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m07:28:03.528237 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFD881B20>]}
[0m07:28:03.528237 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.10s]
[0m07:28:03.529743 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:28:03.530374 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m07:28:03.530374 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m07:28:03.531910 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m07:28:03.532932 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m07:28:03.543262 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:28:03.544771 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m07:28:03.547299 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:28:03.547299 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:28:03.547299 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m07:28:03.548938 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:03.548938 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:03.548938 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:28:03.549956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m07:28:03.621321 [debug] [Thread-1 (]: SQL status: OK in 0.071 seconds
[0m07:28:03.623406 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:28:03.624438 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m07:28:03.624438 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:03.625502 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:28:03.625502 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:28:03.625502 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:28:03.631078 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:28:03.633148 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:28:03.634162 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m07:28:03.634162 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:03.635147 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m07:28:03.636147 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D803A66C0>]}
[0m07:28:03.636147 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m07:28:03.637653 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m07:28:03.637653 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:28:03.637653 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m07:28:03.639220 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m07:28:03.639951 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:28:03.645583 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:28:03.647592 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:28:03.650703 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:28:03.651381 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:28:03.651381 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m07:28:03.651381 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:03.652920 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:03.652920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:28:03.652920 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        -- Ativos
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        -- Passivos
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        (a.ativo_total - l.patrimonio_liquido) as passivo_total,
        l.captacoes
    FROM "silver"."main"."prudential_conglomerates_assets" a
    FULL OUTER JOIN "silver"."main"."prudential_conglomerates_liabilities" l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        -- Ativos
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        -- Passivos
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        (a.ativo_total - l.patrimonio_liquido) as passivo_total,
        l.captacoes
    FROM "silver"."main"."financial_conglomerates_assets" a
    FULL OUTER JOIN "silver"."main"."financial_conglomerates_liabilities" l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        -- Ativos
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        -- Passivos
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        (a.ativo_total - l.patrimonio_liquido) as passivo_total,
        l.captacoes
    FROM "silver"."main"."individual_institutions_assets" a
    FULL OUTER JOIN "silver"."main"."individual_institutions_liabilities" l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m07:28:04.059675 [debug] [Thread-1 (]: SQL status: OK in 0.406 seconds
[0m07:28:04.061288 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:28:04.062291 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m07:28:04.062291 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.063914 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:28:04.063914 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:28:04.063914 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:28:04.246338 [debug] [Thread-1 (]: SQL status: OK in 0.182 seconds
[0m07:28:04.248355 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:28:04.249933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m07:28:04.250490 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.252754 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m07:28:04.253400 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D8047DCD0>]}
[0m07:28:04.254430 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.61s]
[0m07:28:04.255518 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:28:04.256155 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:28:04.256155 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m07:28:04.256685 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m07:28:04.256685 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:28:04.259444 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:28:04.260002 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:28:04.262518 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:28:04.264068 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:28:04.264573 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m07:28:04.264573 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:04.264573 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:04.264573 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:28:04.266120 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m07:28:04.412304 [debug] [Thread-1 (]: SQL status: OK in 0.146 seconds
[0m07:28:04.415027 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:28:04.415027 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m07:28:04.416191 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.417253 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m07:28:04.417253 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:28:04.417253 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m07:28:04.435661 [debug] [Thread-1 (]: SQL status: OK in 0.018 seconds
[0m07:28:04.437662 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:28:04.437662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m07:28:04.437662 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.439661 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m07:28:04.439661 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D80494110>]}
[0m07:28:04.440664 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.18s]
[0m07:28:04.441665 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:28:04.441665 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:28:04.441665 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m07:28:04.442853 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m07:28:04.442853 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:28:04.445405 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:28:04.446411 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:28:04.449931 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:28:04.451138 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:28:04.451138 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m07:28:04.451138 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:04.451138 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.451138 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:28:04.452704 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m07:28:04.490664 [debug] [Thread-1 (]: SQL status: OK in 0.038 seconds
[0m07:28:04.493181 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:28:04.493181 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m07:28:04.494181 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.495260 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m07:28:04.495260 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:28:04.495260 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m07:28:04.535881 [debug] [Thread-1 (]: SQL status: OK in 0.040 seconds
[0m07:28:04.538084 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:28:04.539759 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m07:28:04.540792 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.541966 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m07:28:04.542979 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D804C2D80>]}
[0m07:28:04.542979 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.10s]
[0m07:28:04.544499 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:28:04.545514 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:28:04.545514 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m07:28:04.546643 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m07:28:04.546643 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:28:04.551012 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:28:04.552526 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:28:04.554774 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:28:04.555330 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:28:04.555330 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m07:28:04.555330 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:04.556971 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.556971 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:28:04.557546 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m07:28:04.609847 [debug] [Thread-1 (]: SQL status: OK in 0.052 seconds
[0m07:28:04.612381 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:28:04.612381 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m07:28:04.612381 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.613886 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m07:28:04.615405 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:28:04.615405 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m07:28:04.718733 [debug] [Thread-1 (]: SQL status: OK in 0.103 seconds
[0m07:28:04.721357 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:28:04.722446 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m07:28:04.723461 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:04.724522 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m07:28:04.724522 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D80444770>]}
[0m07:28:04.726035 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.18s]
[0m07:28:04.727042 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:28:04.727042 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:28:04.728051 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m07:28:04.728051 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m07:28:04.728051 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:28:04.734609 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:28:04.735609 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:28:04.740276 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:28:04.740276 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:28:04.742252 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m07:28:04.742787 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:04.742787 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:04.743788 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:28:04.743788 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m07:28:05.268071 [debug] [Thread-1 (]: SQL status: OK in 0.524 seconds
[0m07:28:05.271295 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:28:05.272323 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m07:28:05.272323 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.274003 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:28:05.274003 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:28:05.274003 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:28:05.422733 [debug] [Thread-1 (]: SQL status: OK in 0.148 seconds
[0m07:28:05.427583 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:28:05.428092 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m07:28:05.429663 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.430774 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m07:28:05.430774 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D804B2BA0>]}
[0m07:28:05.432366 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.70s]
[0m07:28:05.433372 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:28:05.433372 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:28:05.433372 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m07:28:05.434371 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m07:28:05.434371 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:28:05.436905 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:28:05.437694 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:28:05.439896 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:28:05.441577 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:28:05.442133 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m07:28:05.442133 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:05.443161 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:05.443161 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:28:05.443161 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m07:28:05.447540 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:28:05.448567 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:28:05.450235 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m07:28:05.450235 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.451753 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m07:28:05.451753 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:28:05.451753 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m07:28:05.462419 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m07:28:05.464021 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:28:05.465027 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m07:28:05.466040 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.467063 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m07:28:05.467573 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D803C7260>]}
[0m07:28:05.467573 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.03s]
[0m07:28:05.468603 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:28:05.469584 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:28:05.469584 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m07:28:05.470578 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m07:28:05.470578 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:28:05.473458 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:28:05.474002 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:28:05.476127 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:28:05.477124 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:28:05.477124 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m07:28:05.478224 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:05.478224 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.478224 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:28:05.478224 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m07:28:05.504538 [debug] [Thread-1 (]: SQL status: OK in 0.025 seconds
[0m07:28:05.506614 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:28:05.507709 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m07:28:05.507709 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.508479 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m07:28:05.508479 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:28:05.509482 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m07:28:05.522551 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m07:28:05.525290 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:28:05.525290 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m07:28:05.525290 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.526862 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m07:28:05.527882 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9EF47E90>]}
[0m07:28:05.527882 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.06s]
[0m07:28:05.528868 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:28:05.528868 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:28:05.529867 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m07:28:05.529867 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m07:28:05.529867 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:28:05.533303 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:28:05.534286 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:28:05.536285 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:28:05.536285 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:28:05.537285 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m07:28:05.537285 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:05.537807 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.538327 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:28:05.538841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    md5(cast(cast(d.codigo as bigint) as varchar))
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m07:28:05.790354 [debug] [Thread-1 (]: SQL status: OK in 0.252 seconds
[0m07:28:05.794013 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:28:05.794013 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m07:28:05.795641 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:05.797673 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m07:28:05.798765 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:28:05.798765 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m07:28:05.985706 [debug] [Thread-1 (]: SQL status: OK in 0.187 seconds
[0m07:28:05.987844 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:28:05.987844 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m07:28:05.987844 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:05.989473 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m07:28:05.990477 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D80475A00>]}
[0m07:28:05.990477 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.46s]
[0m07:28:05.991478 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:28:05.991982 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m07:28:05.991982 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m07:28:05.992987 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m07:28:05.992987 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m07:28:05.992987 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m07:28:06.008637 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:28:06.009770 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m07:28:06.009770 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.010781 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.010781 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:28:06.010781 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m07:28:06.010781 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.018996 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:28:06.018996 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.024759 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:28:06.027939 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:28:06.030109 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m07:28:06.031115 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m07:28:06.031115 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m07:28:06.035458 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:28:06.035458 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m07:28:06.036529 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFF76A150>]}
[0m07:28:06.036529 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.04s]
[0m07:28:06.037493 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m07:28:06.037493 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:28:06.037493 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m07:28:06.038539 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m07:28:06.039539 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:28:06.039539 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:28:06.042230 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:28:06.042230 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m07:28:06.043253 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.043253 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.043253 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:28:06.044265 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m07:28:06.044265 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.046014 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:28:06.046537 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.048571 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.048571 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:28:06.050785 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:28:06.050785 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:28:06.050785 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:28:06.055520 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:28:06.055520 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m07:28:06.056528 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9EF83470>]}
[0m07:28:06.056528 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.02s]
[0m07:28:06.057534 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:28:06.058038 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:28:06.058038 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m07:28:06.058559 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m07:28:06.058559 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:28:06.058559 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:28:06.063735 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:28:06.063735 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m07:28:06.063735 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.064742 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.065247 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:28:06.065247 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m07:28:06.065247 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.066840 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:28:06.066840 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.067846 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.068845 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:28:06.070351 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:28:06.070351 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:28:06.071356 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:28:06.075471 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:28:06.077760 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m07:28:06.077760 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9EF72480>]}
[0m07:28:06.078778 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.02s]
[0m07:28:06.079775 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:28:06.080281 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:28:06.082912 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m07:28:06.083908 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m07:28:06.083908 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:28:06.084913 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:28:06.088010 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:28:06.088010 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m07:28:06.088010 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.089581 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.089581 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:28:06.089581 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m07:28:06.090613 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.090613 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:28:06.091611 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.093151 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.093778 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:28:06.095316 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:28:06.095316 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:28:06.096541 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:28:06.098564 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.098564 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m07:28:06.098564 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9EF7A210>]}
[0m07:28:06.100248 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.01s]
[0m07:28:06.100248 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:28:06.101279 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m07:28:06.101279 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m07:28:06.102409 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m07:28:06.102409 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m07:28:06.102953 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m07:28:06.106040 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:28:06.106542 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m07:28:06.106542 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.106542 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.106542 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:28:06.107572 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m07:28:06.107572 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.108234 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:28:06.108234 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.111654 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.112685 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:28:06.113805 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m07:28:06.113805 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m07:28:06.113805 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m07:28:06.116394 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.117427 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m07:28:06.117427 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFE006AB0>]}
[0m07:28:06.117427 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.02s]
[0m07:28:06.118882 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m07:28:06.118882 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m07:28:06.118882 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m07:28:06.120391 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m07:28:06.120391 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m07:28:06.121401 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m07:28:06.124578 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:28:06.124578 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m07:28:06.124578 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.125605 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.126111 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:28:06.126111 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m07:28:06.126111 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.127117 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:28:06.128143 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.129646 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.130280 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:28:06.131846 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m07:28:06.132212 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m07:28:06.132853 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m07:28:06.134854 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.135853 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m07:28:06.136880 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFFBDDEB0>]}
[0m07:28:06.136880 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.02s]
[0m07:28:06.138360 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m07:28:06.139365 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m07:28:06.139365 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m07:28:06.140370 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m07:28:06.140370 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m07:28:06.140370 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m07:28:06.145394 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:28:06.146533 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m07:28:06.146533 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.147069 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.147575 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:28:06.147575 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m07:28:06.147575 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.149108 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:28:06.149108 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.151267 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.152380 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:28:06.152996 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m07:28:06.152996 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m07:28:06.152996 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m07:28:06.155478 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.157137 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m07:28:06.157649 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D80454230>]}
[0m07:28:06.157649 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.02s]
[0m07:28:06.158182 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m07:28:06.158182 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m07:28:06.159749 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m07:28:06.160352 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m07:28:06.160352 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m07:28:06.160352 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m07:28:06.163456 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:28:06.163994 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m07:28:06.163994 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.163994 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.164998 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:28:06.164998 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m07:28:06.164998 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.166016 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:28:06.166016 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.168222 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.168222 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:28:06.170207 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m07:28:06.171745 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m07:28:06.171745 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m07:28:06.174594 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.175137 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m07:28:06.175137 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D8044EBA0>]}
[0m07:28:06.176143 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.01s]
[0m07:28:06.177143 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m07:28:06.177143 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m07:28:06.178440 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m07:28:06.179440 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m07:28:06.179440 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m07:28:06.179944 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m07:28:06.184437 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:28:06.185436 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m07:28:06.185436 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.186436 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.186436 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:28:06.186436 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m07:28:06.186436 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.187940 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:28:06.187940 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.190129 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.190129 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:28:06.192305 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m07:28:06.193311 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m07:28:06.193311 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m07:28:06.196331 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.196331 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m07:28:06.197330 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D8043DD30>]}
[0m07:28:06.197834 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.02s]
[0m07:28:06.197834 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m07:28:06.197834 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:28:06.198837 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m07:28:06.198837 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m07:28:06.198837 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:28:06.198837 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:28:06.204261 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:28:06.204805 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m07:28:06.205350 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.206360 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.206360 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:28:06.206360 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m07:28:06.208469 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.209477 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:28:06.210285 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:28:06.212294 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.213415 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:28:06.217518 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:28:06.219472 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:28:06.220538 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:28:06.222817 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.223363 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m07:28:06.223363 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D8043F680>]}
[0m07:28:06.224405 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.02s]
[0m07:28:06.224405 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:28:06.224985 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:28:06.224985 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m07:28:06.225511 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m07:28:06.226036 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:28:06.236107 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:28:06.237627 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:28:06.259345 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:28:06.261360 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:28:06.262474 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m07:28:06.262961 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.264971 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.265474 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:28:06.266982 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.270493 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.275177 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m07:28:06.275177 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m07:28:06.276744 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m07:28:06.276744 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.05s]
[0m07:28:06.277760 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:28:06.277760 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:28:06.278761 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m07:28:06.278761 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m07:28:06.278761 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:28:06.283048 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:28:06.284050 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:28:06.286065 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:28:06.286065 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:28:06.286065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m07:28:06.287573 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.287573 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.287573 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:28:06.288590 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.289580 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.290954 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m07:28:06.292123 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m07:28:06.292123 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m07:28:06.292123 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m07:28:06.293153 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:28:06.293153 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:28:06.294157 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m07:28:06.294157 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m07:28:06.295204 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:28:06.299912 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:28:06.301070 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:28:06.303937 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:28:06.304516 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:28:06.305531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m07:28:06.305531 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.305531 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.306566 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:28:06.306566 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:28:06.309559 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.311180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m07:28:06.312722 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m07:28:06.313258 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m07:28:06.313258 [info ] [Thread-1 (]: 24 of 97 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m07:28:06.314850 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:28:06.315355 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:28:06.315355 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m07:28:06.315355 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m07:28:06.315355 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:28:06.318959 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:28:06.321062 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:28:06.323828 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:28:06.324377 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:28:06.324377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m07:28:06.325382 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.325382 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.325382 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:28:06.325382 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.326934 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.328634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m07:28:06.330127 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m07:28:06.330127 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m07:28:06.331133 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m07:28:06.332131 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:28:06.332131 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:28:06.332131 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m07:28:06.333190 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m07:28:06.334188 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:28:06.339249 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:28:06.339878 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:28:06.341990 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:28:06.343001 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:28:06.343001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m07:28:06.343618 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.344137 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.344137 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:28:06.345143 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.346194 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.347702 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m07:28:06.349212 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m07:28:06.349212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m07:28:06.349212 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m07:28:06.350220 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:28:06.351228 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:28:06.351228 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m07:28:06.351228 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m07:28:06.351228 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:28:06.355404 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:28:06.356448 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:28:06.358556 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:28:06.360200 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:28:06.360727 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m07:28:06.360727 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.360727 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.362253 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:28:06.362253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:28:06.363791 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.366360 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m07:28:06.366902 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m07:28:06.366902 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m07:28:06.367911 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m07:28:06.368912 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:28:06.368912 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:28:06.368912 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m07:28:06.370438 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m07:28:06.370438 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:28:06.372230 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:28:06.374534 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:28:06.376161 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:28:06.377192 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:28:06.377192 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m07:28:06.378271 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.378271 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.378271 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:28:06.378271 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.380399 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.380399 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m07:28:06.381980 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m07:28:06.381980 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m07:28:06.382985 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m07:28:06.382985 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:28:06.383986 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:28:06.383986 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m07:28:06.383986 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m07:28:06.383986 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:28:06.387525 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:28:06.387525 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:28:06.390063 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:28:06.391577 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:28:06.391577 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m07:28:06.392194 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.392194 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.392194 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:28:06.393202 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:28:06.395317 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.396582 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m07:28:06.397577 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m07:28:06.398118 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m07:28:06.398621 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m07:28:06.398621 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:28:06.398621 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:28:06.400178 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m07:28:06.400751 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m07:28:06.400751 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:28:06.404550 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:28:06.406608 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:28:06.408659 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:28:06.409783 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:28:06.409783 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m07:28:06.409783 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.410792 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.410792 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:28:06.410792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.412302 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.413327 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m07:28:06.414963 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m07:28:06.414963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m07:28:06.415466 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.01s]
[0m07:28:06.415971 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:28:06.415971 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:28:06.416979 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m07:28:06.417484 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m07:28:06.417484 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:28:06.420992 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:28:06.423237 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:28:06.425374 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:28:06.426997 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:28:06.428010 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m07:28:06.428010 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.428010 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.428010 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:28:06.428010 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.430112 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.431116 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m07:28:06.432134 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m07:28:06.432134 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m07:28:06.433239 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m07:28:06.434222 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:28:06.434222 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:28:06.434222 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:28:06.435225 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m07:28:06.435225 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:28:06.443713 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:28:06.445307 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:28:06.448457 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:28:06.448457 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:28:06.450300 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m07:28:06.450300 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.450883 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.450883 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:28:06.450883 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.455629 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:28:06.457837 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m07:28:06.459386 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m07:28:06.460026 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m07:28:06.461061 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:28:06.462568 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:28:06.462568 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:28:06.463575 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:28:06.464765 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m07:28:06.464765 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:28:06.471129 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:28:06.472219 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:28:06.475382 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:28:06.475916 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:28:06.475916 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m07:28:06.476923 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.476923 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.477928 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:28:06.477928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.487872 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m07:28:06.492943 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m07:28:06.493943 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m07:28:06.495549 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m07:28:06.496571 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:28:06.496571 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:28:06.497553 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:28:06.497553 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m07:28:06.498583 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m07:28:06.499104 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:28:06.501351 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:28:06.501351 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:28:06.505310 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:28:06.506315 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:28:06.506820 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m07:28:06.506820 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.507325 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.507325 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:28:06.507325 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.509399 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.509950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m07:28:06.510955 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m07:28:06.510955 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m07:28:06.510955 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.01s]
[0m07:28:06.512483 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:28:06.512483 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:28:06.512483 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m07:28:06.513499 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m07:28:06.514003 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:28:06.516755 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:28:06.517783 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:28:06.521301 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:28:06.522392 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:28:06.522392 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m07:28:06.522392 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.523473 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.523473 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:28:06.523473 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.524507 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.525520 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m07:28:06.527069 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m07:28:06.527069 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m07:28:06.528083 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m07:28:06.528083 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:28:06.529596 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:28:06.529596 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:28:06.530292 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m07:28:06.530292 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:28:06.533875 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:28:06.534853 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:28:06.537953 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:28:06.539619 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:28:06.539619 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m07:28:06.539619 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.540642 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.540642 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:28:06.540642 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.544654 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:28:06.545827 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m07:28:06.547363 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m07:28:06.547363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m07:28:06.547363 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:28:06.548366 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:28:06.548366 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:28:06.548366 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:28:06.550649 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m07:28:06.550649 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:28:06.554518 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:28:06.555529 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:28:06.558149 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:28:06.559225 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:28:06.559225 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m07:28:06.560737 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.560737 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.561743 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:28:06.561743 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.566390 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:28:06.566953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m07:28:06.567984 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m07:28:06.568978 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m07:28:06.568978 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:28:06.568978 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:28:06.570484 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:28:06.570484 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m07:28:06.571080 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m07:28:06.571624 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:28:06.575370 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:28:06.575874 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:28:06.578422 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:28:06.578422 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:28:06.579405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m07:28:06.579405 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.579924 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.579924 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:28:06.579924 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.580936 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.581963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m07:28:06.582991 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m07:28:06.583990 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m07:28:06.583990 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m07:28:06.584990 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:28:06.584990 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:28:06.584990 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m07:28:06.585988 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m07:28:06.585988 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:28:06.590058 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:28:06.592277 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:28:06.594362 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:28:06.595394 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:28:06.595901 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m07:28:06.595901 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.595901 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.595901 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:28:06.595901 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.598417 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.598417 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m07:28:06.600581 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m07:28:06.601168 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m07:28:06.601168 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m07:28:06.601168 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:28:06.601168 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:28:06.602743 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:28:06.603283 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m07:28:06.603283 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:28:06.607551 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:28:06.609122 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:28:06.611199 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:28:06.612200 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:28:06.612707 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m07:28:06.612707 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.612707 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.613713 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:28:06.613713 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.616229 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.617744 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m07:28:06.617744 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m07:28:06.618757 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m07:28:06.618757 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:28:06.618757 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:28:06.620263 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:28:06.620263 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:28:06.621268 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m07:28:06.621268 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:28:06.625614 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:28:06.625614 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:28:06.627706 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:28:06.628715 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:28:06.629714 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m07:28:06.630219 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.630219 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.631224 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:28:06.631224 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.634736 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:28:06.635743 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m07:28:06.635743 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m07:28:06.637296 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m07:28:06.637296 [info ] [Thread-1 (]: 41 of 97 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:28:06.637903 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:28:06.637903 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:28:06.637903 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m07:28:06.639661 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m07:28:06.639661 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:28:06.643253 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:28:06.644766 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:28:06.646277 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:28:06.647277 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:28:06.647277 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m07:28:06.647277 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.648937 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.648937 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:28:06.648937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.650490 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.651017 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m07:28:06.653051 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m07:28:06.653051 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m07:28:06.653051 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m07:28:06.654653 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:28:06.654653 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:28:06.654653 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m07:28:06.655661 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m07:28:06.655661 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:28:06.659318 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:28:06.660363 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:28:06.662473 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:28:06.663481 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:28:06.663481 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m07:28:06.664021 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.664021 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.665055 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:28:06.666652 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.667158 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.668166 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m07:28:06.669165 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m07:28:06.669165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m07:28:06.669165 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.01s]
[0m07:28:06.671490 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:28:06.671490 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:28:06.672062 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:28:06.672062 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m07:28:06.672062 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:28:06.675290 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:28:06.677882 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:28:06.680432 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:28:06.681936 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:28:06.681936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m07:28:06.681936 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.682941 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.682941 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:28:06.682941 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.685455 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.687956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m07:28:06.689505 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m07:28:06.689505 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m07:28:06.689505 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:28:06.690515 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:28:06.691514 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:28:06.691514 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:28:06.692062 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m07:28:06.692062 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:28:06.697678 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:28:06.698789 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:28:06.703008 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:28:06.704018 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:28:06.704592 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m07:28:06.704592 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.704592 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.705607 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:28:06.705607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.711092 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:28:06.712597 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m07:28:06.713606 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m07:28:06.714111 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m07:28:06.714111 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:28:06.715120 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:28:06.715120 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:28:06.716127 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m07:28:06.716127 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m07:28:06.716127 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:28:06.719691 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:28:06.720222 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:28:06.722424 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:28:06.723431 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:28:06.723936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m07:28:06.723936 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.724463 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.724463 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:28:06.724463 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.725470 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.727454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m07:28:06.728462 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m07:28:06.728462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m07:28:06.728462 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m07:28:06.729967 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:28:06.729967 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:28:06.729967 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m07:28:06.730972 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m07:28:06.730972 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:28:06.735100 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:28:06.736100 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:28:06.737608 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:28:06.738617 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:28:06.738617 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m07:28:06.739619 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.740125 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.740125 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:28:06.740125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.740125 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.742179 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m07:28:06.743187 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m07:28:06.743187 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m07:28:06.743187 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m07:28:06.744190 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:28:06.744190 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:28:06.744190 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:28:06.744190 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m07:28:06.745880 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:28:06.750121 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:28:06.751297 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:28:06.754456 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:28:06.755463 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:28:06.755970 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m07:28:06.756475 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.756475 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.756475 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:28:06.757511 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.761125 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:28:06.762634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m07:28:06.763645 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m07:28:06.764152 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m07:28:06.764152 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:28:06.765156 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:28:06.765156 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:28:06.765156 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:28:06.766161 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m07:28:06.766161 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:28:06.770212 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:28:06.771222 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:28:06.772356 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:28:06.774553 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:28:06.774553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m07:28:06.775560 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.775560 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.775560 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:28:06.775560 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.784554 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m07:28:06.786569 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m07:28:06.788066 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m07:28:06.788066 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m07:28:06.788066 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:28:06.788066 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:28:06.789570 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:28:06.789570 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m07:28:06.790578 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m07:28:06.790578 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:28:06.794121 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:28:06.795841 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:28:06.798496 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:28:06.800009 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:28:06.800009 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m07:28:06.800559 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.800559 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.801192 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:28:06.801192 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.801192 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.803448 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m07:28:06.804961 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m07:28:06.805468 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m07:28:06.805468 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m07:28:06.806474 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:28:06.806474 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:28:06.806474 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m07:28:06.807693 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m07:28:06.807693 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:28:06.811259 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:28:06.812265 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:28:06.813888 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:28:06.815399 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:28:06.815904 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m07:28:06.815904 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.815904 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.816911 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:28:06.816911 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.817420 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.818422 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m07:28:06.819422 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m07:28:06.819422 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m07:28:06.820423 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m07:28:06.820930 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:28:06.821504 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:28:06.821504 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:28:06.822510 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m07:28:06.822510 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:28:06.825648 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:28:06.827295 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:28:06.829810 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:28:06.830817 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:28:06.831819 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m07:28:06.831819 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.832324 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.832324 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:28:06.832324 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.834330 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.835330 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m07:28:06.835869 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m07:28:06.835869 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m07:28:06.837381 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m07:28:06.838004 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:28:06.838004 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:28:06.838004 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:28:06.839595 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m07:28:06.839595 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:28:06.845804 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:28:06.847417 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:28:06.849146 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:28:06.850815 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:28:06.851331 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m07:28:06.851331 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.851331 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.852339 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:28:06.852339 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.854531 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.856045 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m07:28:06.856549 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m07:28:06.856549 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m07:28:06.857661 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:28:06.858274 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:28:06.859279 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:28:06.859279 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m07:28:06.860498 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m07:28:06.860498 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:28:06.863514 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:28:06.864048 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:28:06.866383 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:28:06.867047 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:28:06.868060 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m07:28:06.868060 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.868060 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.869062 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:28:06.869062 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.869062 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.872313 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m07:28:06.873348 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m07:28:06.873348 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m07:28:06.873348 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m07:28:06.874613 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:28:06.874613 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:28:06.875622 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m07:28:06.875622 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m07:28:06.875622 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:28:06.879753 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:28:06.880317 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:28:06.881892 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:28:06.883901 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:28:06.883901 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m07:28:06.883901 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.884900 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.884900 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:28:06.884900 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.885900 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:06.887403 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m07:28:06.887944 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m07:28:06.887944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m07:28:06.889616 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m07:28:06.889616 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:28:06.889616 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:28:06.890624 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:28:06.891622 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m07:28:06.891622 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:28:06.897747 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:28:06.898761 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:28:06.900865 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:28:06.902990 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:28:06.902990 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m07:28:06.902990 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.903997 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.904656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:28:06.904656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.906469 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:06.907599 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m07:28:06.908607 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m07:28:06.909113 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m07:28:06.909113 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:28:06.910224 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:28:06.910224 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:28:06.911230 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:28:06.911230 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m07:28:06.911230 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:28:06.916264 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:28:06.917276 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:28:06.921689 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:28:06.923343 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:28:06.923343 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m07:28:06.923849 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.924352 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.924352 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:28:06.924352 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.928876 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:28:06.929927 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m07:28:06.930948 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m07:28:06.930948 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m07:28:06.931951 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:28:06.931951 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:28:06.931951 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:28:06.933232 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m07:28:06.933232 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m07:28:06.934233 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:28:06.937234 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:28:06.937743 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:28:06.940259 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:28:06.941265 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:28:06.941793 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m07:28:06.942799 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.942799 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.944311 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:28:06.944311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.945321 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.947279 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m07:28:06.947279 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m07:28:06.947279 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m07:28:06.948871 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.02s]
[0m07:28:06.950389 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:28:06.951395 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:28:06.952595 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m07:28:06.953135 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m07:28:06.953135 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:28:06.956407 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:28:06.957418 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:28:06.958531 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:28:06.960039 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:28:06.960039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m07:28:06.960039 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.961046 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.961046 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:28:06.961046 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.962555 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.964073 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m07:28:06.964073 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m07:28:06.965079 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m07:28:06.965079 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m07:28:06.966974 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:28:06.966974 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:28:06.967983 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:28:06.967983 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m07:28:06.967983 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:28:06.972158 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:28:06.974298 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:28:06.976850 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:28:06.977873 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:28:06.978463 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m07:28:06.978463 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:06.979497 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:06.979497 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:28:06.980049 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:06.983934 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:28:06.985937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m07:28:06.985937 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m07:28:06.985937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m07:28:06.987448 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:28:06.988089 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:28:06.988089 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:28:06.988089 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:28:06.989628 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m07:28:06.989628 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:28:06.994151 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:28:06.994658 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:28:06.996412 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:28:06.998492 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:28:06.998492 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m07:28:06.998492 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:07.000210 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:07.000210 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:28:07.000210 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:07.005382 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:28:07.006435 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m07:28:07.007485 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m07:28:07.007485 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m07:28:07.008018 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:28:07.008543 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:28:07.008543 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m07:28:07.009550 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m07:28:07.010053 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m07:28:07.010053 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m07:28:07.012307 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m07:28:07.013821 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m07:28:07.018913 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m07:28:07.018913 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:28:07.018913 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m07:28:07.020419 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:07.020973 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:07.020973 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:28:07.021499 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m07:28:07.022063 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:07.027186 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:28:07.027717 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m07:28:07.027717 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:07.029733 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m07:28:07.030241 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:28:07.030241 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m07:28:07.035294 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:28:07.037302 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:28:07.037807 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m07:28:07.037807 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:07.039375 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m07:28:07.039375 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9EFBC830>]}
[0m07:28:07.040382 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.03s]
[0m07:28:07.040382 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m07:28:07.041380 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:28:07.041884 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m07:28:07.042403 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m07:28:07.042403 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:28:07.043916 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:28:07.045538 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:28:07.049134 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:28:07.050821 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:28:07.050821 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m07:28:07.050821 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:07.050821 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:07.052411 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:28:07.052959 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m07:28:07.053964 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:07.056593 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:28:07.057098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m07:28:07.057608 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:07.058157 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:28:07.058157 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:28:07.059725 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:28:07.062354 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:28:07.065035 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:28:07.065542 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m07:28:07.066047 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:07.067055 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m07:28:07.067055 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D80432540>]}
[0m07:28:07.068433 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m07:28:07.068433 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:28:07.069405 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:28:07.069405 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m07:28:07.070912 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m07:28:07.072426 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m07:28:07.074472 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:28:07.075980 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m07:28:07.080501 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:28:07.080501 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:28:07.082007 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m07:28:07.082007 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:07.083015 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:07.083015 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:28:07.083015 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m07:28:07.084015 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:07.086013 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:28:07.087520 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m07:28:07.087520 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:07.089598 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:28:07.089598 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:28:07.089598 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:28:07.092648 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:28:07.095669 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:28:07.095669 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m07:28:07.095669 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:07.096670 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m07:28:07.097686 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9F093440>]}
[0m07:28:08.054234 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m07:28:08.060681 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m07:28:08.062831 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:28:08.063843 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m07:28:08.064854 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m07:28:08.066625 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m07:28:08.067225 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m07:28:08.071247 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:28:08.071975 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m07:28:08.077270 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:28:08.078260 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:28:08.078260 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m07:28:08.079767 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.080407 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.080407 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:28:08.080407 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m07:28:08.081944 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.085967 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:28:08.085967 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m07:28:08.088525 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.090030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:28:08.090030 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:28:08.090030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:28:08.096426 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:28:08.098436 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:28:08.098436 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m07:28:08.100010 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.101233 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m07:28:08.102889 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DF7E32480>]}
[0m07:28:08.102889 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.04s]
[0m07:28:08.102889 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m07:28:08.102889 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:28:08.104451 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m07:28:08.105091 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m07:28:08.105619 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:28:08.107737 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:28:08.108343 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:28:08.110928 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:28:08.112435 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:28:08.113443 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m07:28:08.113990 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.115021 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.115021 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:28:08.116249 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m07:28:08.117795 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.124768 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:28:08.125349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m07:28:08.126990 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.128018 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m07:28:08.129530 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:28:08.130088 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m07:28:08.132848 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:08.136513 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:28:08.137517 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m07:28:08.138576 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.140107 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m07:28:08.140107 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9F0A6A80>]}
[0m07:28:08.141613 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.04s]
[0m07:28:08.142166 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:28:08.142166 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m07:28:08.143170 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m07:28:08.144169 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m07:28:08.144169 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m07:28:08.147814 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m07:28:08.150004 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m07:28:08.154609 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m07:28:08.157374 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:28:08.157374 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m07:28:08.157912 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.158550 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.158550 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:28:08.159556 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m07:28:08.161063 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.164747 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:28:08.164747 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m07:28:08.166287 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.167511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m07:28:08.167511 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:28:08.168549 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m07:28:08.171146 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:08.173831 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:28:08.173831 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m07:28:08.174473 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.175502 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m07:28:08.175502 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFB32E000>]}
[0m07:28:08.177091 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.03s]
[0m07:28:08.178108 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m07:28:08.178108 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:28:08.178108 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m07:28:08.180184 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m07:28:08.180184 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:28:08.184432 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:28:08.185433 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:28:08.190573 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:28:08.192210 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:28:08.192210 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m07:28:08.193215 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.193215 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.193215 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:28:08.194236 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m07:28:08.195446 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.199973 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:28:08.200604 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m07:28:08.201263 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.201767 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m07:28:08.201767 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:28:08.201767 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m07:28:08.203275 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:08.208298 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:28:08.208298 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m07:28:08.209810 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.210318 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m07:28:08.211329 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9F0CF9B0>]}
[0m07:28:08.211329 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.03s]
[0m07:28:08.212324 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:28:08.212827 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m07:28:08.212827 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m07:28:08.213833 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m07:28:08.213833 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m07:28:08.217134 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m07:28:08.217134 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m07:28:08.219164 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m07:28:08.221250 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:28:08.221881 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m07:28:08.222435 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.222435 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.223442 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:28:08.223967 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m07:28:08.224582 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.227110 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:28:08.227110 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m07:28:08.228383 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.229662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m07:28:08.229662 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:28:08.230212 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m07:28:08.232220 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:08.234490 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:28:08.235490 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m07:28:08.235490 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.236490 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m07:28:08.237508 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D8047D490>]}
[0m07:28:08.237508 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m07:28:08.238735 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m07:28:08.238735 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m07:28:08.239734 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m07:28:08.239734 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m07:28:08.239734 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m07:28:08.241871 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m07:28:08.242901 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m07:28:08.245661 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m07:28:08.246234 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:28:08.247745 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m07:28:08.247745 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.248758 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.248758 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:28:08.250555 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m07:28:08.251090 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.254344 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:28:08.254344 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m07:28:08.255710 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.257878 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m07:28:08.258509 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:28:08.259524 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m07:28:08.261036 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.262540 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:28:08.262540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m07:28:08.264048 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.265059 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m07:28:08.266165 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9EFC1940>]}
[0m07:28:08.267280 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.03s]
[0m07:28:08.268321 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m07:28:08.268321 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m07:28:08.269345 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m07:28:08.269345 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m07:28:08.269345 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m07:28:08.271364 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:28:08.272454 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m07:28:08.275867 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:28:08.276901 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:28:08.277989 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m07:28:08.277989 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.277989 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.277989 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:28:08.279495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m07:28:08.280074 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.282087 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:28:08.282087 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m07:28:08.283131 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.285126 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:28:08.285126 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:28:08.286109 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:28:08.287628 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.289634 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:28:08.289634 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m07:28:08.291234 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.292281 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m07:28:08.292281 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9EFD1880>]}
[0m07:28:08.292281 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m07:28:08.293295 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m07:28:08.293295 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:28:08.294293 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m07:28:08.295439 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m07:28:08.295439 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:28:08.298514 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:28:08.300115 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:28:08.301295 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:28:08.302889 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:28:08.302889 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m07:28:08.302889 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.302889 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.304539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:28:08.304539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m07:28:08.304539 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.306577 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m07:28:08.307645 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m07:28:08.307645 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m07:28:08.308231 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m07:28:08.308231 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:28:08.308231 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:28:08.309841 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m07:28:08.309841 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m07:28:08.310849 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:28:08.315011 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:28:08.316137 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:28:08.317685 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:28:08.318676 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:28:08.318676 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m07:28:08.318676 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.320183 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.320183 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:28:08.321216 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:08.322574 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.323605 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m07:28:08.324712 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m07:28:08.324712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m07:28:08.325270 [info ] [Thread-1 (]: 73 of 97 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:28:08.325270 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:28:08.325270 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:28:08.326870 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m07:28:08.326870 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m07:28:08.326870 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:28:08.330389 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:28:08.330389 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:28:08.333040 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:28:08.334015 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:28:08.334015 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m07:28:08.334015 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.335015 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.335015 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:28:08.335015 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:28:08.336044 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.338207 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m07:28:08.338207 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m07:28:08.338207 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m07:28:08.339747 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.01s]
[0m07:28:08.339747 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:28:08.339747 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:28:08.339747 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m07:28:08.341326 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m07:28:08.341326 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:28:08.345378 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:28:08.346482 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:28:08.348474 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:28:08.350022 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:28:08.350022 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m07:28:08.350577 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.351127 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.351127 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:28:08.351127 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m07:28:08.351127 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.353364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m07:28:08.353902 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m07:28:08.354453 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m07:28:08.355005 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m07:28:08.355527 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:28:08.355527 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:28:08.355527 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m07:28:08.356535 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m07:28:08.356535 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:28:08.361311 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:28:08.362319 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:28:08.363761 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:28:08.364798 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:28:08.364798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m07:28:08.364798 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.366739 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.366739 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:28:08.366739 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:08.368748 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.370005 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m07:28:08.370561 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m07:28:08.371188 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m07:28:08.371788 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m07:28:08.372330 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:28:08.372330 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:28:08.373335 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m07:28:08.373335 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m07:28:08.373335 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:28:08.377116 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:28:08.378168 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:28:08.380188 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:28:08.381238 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:28:08.381238 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m07:28:08.381238 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.382201 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.382201 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:28:08.382201 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:28:08.383309 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.385294 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m07:28:08.385831 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m07:28:08.385831 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m07:28:08.385831 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m07:28:08.387337 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:28:08.387337 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:28:08.387874 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m07:28:08.387874 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m07:28:08.387874 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:28:08.391461 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:28:08.391988 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:28:08.394022 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:28:08.394022 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:28:08.395649 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m07:28:08.395649 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.396652 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.396652 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:28:08.396652 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m07:28:08.397656 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.398665 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m07:28:08.398665 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m07:28:08.400215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m07:28:08.400215 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m07:28:08.401222 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:28:08.401728 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:28:08.401728 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m07:28:08.402734 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m07:28:08.402734 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:28:08.406472 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:28:08.408146 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:28:08.410752 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:28:08.412296 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:28:08.412296 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m07:28:08.412296 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.413322 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.413322 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:28:08.413908 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:08.414915 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.416887 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m07:28:08.417556 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m07:28:08.417556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m07:28:08.418559 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m07:28:08.418559 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:28:08.419546 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:28:08.419546 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m07:28:08.419546 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m07:28:08.420762 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:28:08.423481 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:28:08.424724 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:28:08.425330 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:28:08.426888 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:28:08.426888 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m07:28:08.426888 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.427922 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:08.427922 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:28:08.427922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:28:08.429441 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.430003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m07:28:08.431024 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m07:28:08.431024 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m07:28:08.432513 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m07:28:08.432513 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:28:08.433523 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:28:08.434521 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m07:28:08.434521 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m07:28:08.435523 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:28:08.438024 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:28:08.439539 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:28:08.442051 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:28:08.443058 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:28:08.444057 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m07:28:08.444564 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:08.444564 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:08.444564 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:28:08.445567 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:28:15.580875 [debug] [Thread-1 (]: SQL status: OK in 7.135 seconds
[0m07:28:15.583448 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:28:15.583448 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m07:28:15.584453 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:15.585454 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m07:28:15.585454 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:28:15.585454 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m07:28:15.736318 [debug] [Thread-1 (]: SQL status: OK in 0.150 seconds
[0m07:28:15.739491 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:28:15.740500 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m07:28:15.741497 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:15.742121 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m07:28:15.743149 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9F11B0B0>]}
[0m07:28:15.743149 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 7.31s]
[0m07:28:15.744133 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:28:15.744133 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:28:15.745193 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m07:28:15.745923 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m07:28:15.745923 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:28:15.749695 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:28:15.750217 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:28:15.752860 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:28:15.752860 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:28:15.752860 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m07:28:15.752860 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:15.754533 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:15.754533 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:28:15.755540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:28:15.894153 [debug] [Thread-1 (]: SQL status: OK in 0.138 seconds
[0m07:28:15.896262 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:28:15.897874 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m07:28:15.897874 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:15.898923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m07:28:15.898923 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:28:15.898923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m07:28:15.910456 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m07:28:15.912478 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:28:15.912478 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m07:28:15.912478 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:15.913566 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m07:28:15.914603 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9F0B5910>]}
[0m07:28:15.914603 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.17s]
[0m07:28:15.916156 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:28:15.916156 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:28:15.916156 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m07:28:15.917162 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m07:28:15.917162 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:28:15.920396 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:28:15.921417 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:28:15.924295 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:28:15.925299 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:28:15.925806 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m07:28:15.925806 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:15.925806 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:15.925806 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:28:15.926827 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m07:28:28.424650 [debug] [Thread-1 (]: SQL status: OK in 12.498 seconds
[0m07:28:28.427155 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:28:28.427522 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m07:28:28.428258 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:28.428258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m07:28:28.428258 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:28:28.428258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m07:28:28.475727 [debug] [Thread-1 (]: SQL status: OK in 0.047 seconds
[0m07:28:28.478488 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:28:28.478488 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m07:28:28.478488 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:28.480091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m07:28:28.481102 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D803A6960>]}
[0m07:28:28.481102 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 12.56s]
[0m07:28:28.482156 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:28:28.482156 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:28:28.482156 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m07:28:28.483294 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m07:28:28.483294 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:28:28.486984 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:28:28.487496 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:28:28.490674 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:28:28.492176 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:28:28.492176 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m07:28:28.492176 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:28.493178 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:28.493178 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:28:28.493178 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:28:28.708537 [debug] [Thread-1 (]: SQL status: OK in 0.214 seconds
[0m07:28:28.710552 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:28:28.710552 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m07:28:28.711557 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:28.712062 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m07:28:28.712567 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:28:28.712567 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m07:28:28.730438 [debug] [Thread-1 (]: SQL status: OK in 0.018 seconds
[0m07:28:28.734126 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:28:28.735123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m07:28:28.735123 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:28.736106 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m07:28:28.736106 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9F1032C0>]}
[0m07:28:28.737122 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.25s]
[0m07:28:28.737665 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:28:28.737665 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:28:28.738672 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m07:28:28.738672 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m07:28:28.739670 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:28:28.741702 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:28:28.742744 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:28:28.745763 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:28:28.745763 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:28:28.745763 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m07:28:28.745763 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:28.747850 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:28.747850 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:28:28.748352 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:28:29.039975 [debug] [Thread-1 (]: SQL status: OK in 0.292 seconds
[0m07:28:29.043267 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:28:29.043267 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m07:28:29.044515 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.044515 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m07:28:29.045913 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:28:29.045913 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m07:28:29.104261 [debug] [Thread-1 (]: SQL status: OK in 0.058 seconds
[0m07:28:29.110806 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:28:29.110806 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m07:28:29.112313 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.116354 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m07:28:29.117051 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '86387a38-ca01-4e29-af60-dca31c6782bb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025D9F093B30>]}
[0m07:28:29.119099 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.38s]
[0m07:28:29.121250 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:28:29.122723 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:28:29.125506 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m07:28:29.127108 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m07:28:29.127108 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:28:29.130344 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:28:29.131355 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:28:29.132887 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:28:29.132887 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:28:29.132887 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m07:28:29.134410 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.134410 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.134410 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:28:29.135439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.135439 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.136438 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m07:28:29.137438 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m07:28:29.137438 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m07:28:29.138115 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m07:28:29.138115 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:28:29.138115 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:28:29.139771 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m07:28:29.140776 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m07:28:29.140776 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:28:29.144683 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:28:29.145684 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:28:29.148400 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:28:29.149952 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:28:29.150460 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m07:28:29.150981 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.151338 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.151338 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:28:29.151986 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.152985 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:28:29.155759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m07:28:29.156897 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m07:28:29.156897 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m07:28:29.157553 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m07:28:29.158238 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:28:29.158238 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:28:29.159923 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m07:28:29.159923 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m07:28:29.160927 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:28:29.165383 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:28:29.166384 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:28:29.167889 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:28:29.168891 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:28:29.168891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m07:28:29.168891 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.168891 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.168891 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:28:29.170394 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:28:29.173495 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:28:29.174588 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m07:28:29.175618 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m07:28:29.175618 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m07:28:29.175618 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m07:28:29.177686 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:28:29.178271 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:28:29.178271 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m07:28:29.179773 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m07:28:29.180119 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:28:29.183139 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:28:29.184137 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:28:29.185153 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:28:29.186152 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:28:29.186152 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m07:28:29.186152 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.187660 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.187660 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:28:29.187660 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.188666 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.190169 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m07:28:29.190169 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m07:28:29.190169 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m07:28:29.190169 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m07:28:29.191672 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:28:29.191672 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:28:29.192676 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m07:28:29.192676 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m07:28:29.192676 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:28:29.195501 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:28:29.196517 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:28:29.198681 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:28:29.200653 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:28:29.200653 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m07:28:29.201158 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.201158 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.201158 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:28:29.201158 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.202851 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.202851 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m07:28:29.204513 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m07:28:29.205546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m07:28:29.205546 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m07:28:29.206725 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:28:29.206725 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:28:29.207862 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m07:28:29.208430 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m07:28:29.208430 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:28:29.210996 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:28:29.212504 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:28:29.214009 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:28:29.214311 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:28:29.215012 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m07:28:29.215012 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.215514 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.216039 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:28:29.216039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.217068 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:29.218673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m07:28:29.218673 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m07:28:29.218673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m07:28:29.220193 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.01s]
[0m07:28:29.221230 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:28:29.221752 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:28:29.221752 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m07:28:29.222343 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m07:28:29.222343 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:28:29.225667 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:28:29.227456 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:28:29.231992 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:28:29.231992 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:28:29.233164 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m07:28:29.233164 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.235160 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:29.235160 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:28:29.236164 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.237669 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:29.239690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m07:28:29.240853 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m07:28:29.241358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m07:28:29.242273 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.02s]
[0m07:28:29.244309 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:28:29.244309 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:28:29.245319 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m07:28:29.245319 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m07:28:29.246358 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:28:29.249014 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:28:29.250519 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:28:29.254472 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:28:29.255519 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:28:29.255519 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m07:28:29.256547 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.256547 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.256547 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:28:29.257628 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.257628 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.259498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m07:28:29.260103 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m07:28:29.260103 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m07:28:29.260103 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.01s]
[0m07:28:29.261108 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:28:29.261108 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:28:29.262935 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m07:28:29.263439 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m07:28:29.264195 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:28:29.267933 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:28:29.267933 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:28:29.271697 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:28:29.272364 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:28:29.272364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m07:28:29.272364 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.274059 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.274059 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:28:29.274059 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.275637 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:29.277226 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m07:28:29.278253 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m07:28:29.278253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m07:28:29.279777 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m07:28:29.280517 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:28:29.280517 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:28:29.280517 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m07:28:29.282151 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m07:28:29.282151 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:28:29.287656 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:28:29.288658 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:28:29.291683 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:28:29.292989 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:28:29.293982 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m07:28:29.293982 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.294496 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.294496 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:28:29.294496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.300890 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:28:29.302467 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m07:28:29.304143 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m07:28:29.304143 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m07:28:29.304648 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m07:28:29.304648 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:28:29.306099 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:28:29.306099 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m07:28:29.306710 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m07:28:29.307231 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:28:29.310044 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:28:29.311051 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:28:29.313559 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:28:29.314062 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:28:29.314062 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m07:28:29.315065 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.315065 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.315065 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:28:29.315065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.317194 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:29.319196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m07:28:29.320201 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m07:28:29.321277 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m07:28:29.321277 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.01s]
[0m07:28:29.322345 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:28:29.322345 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:28:29.322345 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m07:28:29.323974 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m07:28:29.324553 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:28:29.330325 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:28:29.331934 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:28:29.334224 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:28:29.336257 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:28:29.336257 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m07:28:29.336257 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:28:29.337250 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:28:29.337774 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:28:29.337774 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m07:28:29.337774 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:28:29.340333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m07:28:29.341839 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m07:28:29.342871 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m07:28:29.342871 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.02s]
[0m07:28:29.345402 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:28:29.346860 [debug] [MainThread]: Using duckdb connection "master"
[0m07:28:29.347441 [debug] [MainThread]: On master: BEGIN
[0m07:28:29.347441 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m07:28:29.348448 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m07:28:29.348448 [debug] [MainThread]: On master: COMMIT
[0m07:28:29.348448 [debug] [MainThread]: Using duckdb connection "master"
[0m07:28:29.348448 [debug] [MainThread]: On master: COMMIT
[0m07:28:29.350164 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:28:29.350164 [debug] [MainThread]: On master: Close
[0m07:28:29.350879 [debug] [MainThread]: Connection 'master' was properly closed.
[0m07:28:29.350879 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m07:28:29.350879 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m07:28:29.350879 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m07:28:29.350879 [info ] [MainThread]: 
[0m07:28:29.352445 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 27.02 seconds (27.02s).
[0m07:28:29.361027 [debug] [MainThread]: Command end result
[0m07:28:29.474304 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:28:29.475413 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:28:29.483970 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m07:28:29.483970 [info ] [MainThread]: 
[0m07:28:29.484969 [info ] [MainThread]: [32mCompleted successfully[0m
[0m07:28:29.484969 [info ] [MainThread]: 
[0m07:28:29.484969 [info ] [MainThread]: Done. PASS=97 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=97
[0m07:28:29.485971 [debug] [MainThread]: Command `dbt build` succeeded at 07:28:29.485971 after 28.38 seconds
[0m07:28:29.486970 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFE305880>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFD842660>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000025DFF814650>]}
[0m07:28:29.486970 [debug] [MainThread]: Flushing usage events
[0m07:28:30.253551 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m07:47:02.433761 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000274267AE090>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002742905F230>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002742905FAA0>]}


============================== 07:47:02.437916 | 928eb4e5-a628-4470-85ce-7bf45680bd8a ==============================
[0m07:47:02.437916 [info ] [MainThread]: Running with dbt=1.11.5
[0m07:47:02.437916 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': '.', 'invocation_command': 'dbt build --select gold --profiles-dir .', 'use_colors': 'True', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m07:47:02.447386 [error] [MainThread]: Encountered an error:
Parsing Error
  Env var required but not provided: 'GOLD_DB_PATH'
[0m07:47:02.448454 [debug] [MainThread]: Command `dbt build` failed at 07:47:02.448454 after 0.22 seconds
[0m07:47:02.448454 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002742905F230>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000027429AC5D00>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000274299C7560>]}
[0m07:47:02.448454 [debug] [MainThread]: Flushing usage events
[0m07:47:03.318932 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m07:47:19.892197 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E7ADF920>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E4EBF620>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E7095BE0>]}


============================== 07:47:19.897316 | a53e74a9-75f6-4304-a05e-0bb6ae1ea081 ==============================
[0m07:47:19.897316 [info ] [MainThread]: Running with dbt=1.11.5
[0m07:47:19.897316 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'fail_fast': 'False', 'debug': 'False', 'log_format': 'default', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': '.', 'invocation_command': 'dbt build --select gold --profiles-dir .', 'use_colors': 'True', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m07:47:20.100972 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9114B00>]}
[0m07:47:20.160731 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E7148170>]}
[0m07:47:20.164983 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m07:47:20.362188 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m07:47:20.448820 [info ] [MainThread]: Unable to do partial parsing because profile has changed
[0m07:47:20.448820 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E77BEBA0>]}
[0m07:47:21.608671 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on 'dim_instituicao'
in package 'bacen_ifdata_analytics' (models\gold\schema.yml). Arguments to
generic tests should be nested under the `arguments` property.
[0m07:47:21.609844 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9935A60>]}
[0m07:47:21.962329 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m07:47:21.971639 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9928620>]}
[0m07:47:22.046640 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:47:22.049077 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:47:22.098801 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E98E3DA0>]}
[0m07:47:22.098801 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m07:47:22.104737 [info ] [MainThread]: 
[0m07:47:22.105270 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m07:47:22.105270 [info ] [MainThread]: 
[0m07:47:22.106837 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m07:47:22.112442 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m07:47:22.185932 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m07:47:22.185932 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m07:47:22.185932 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:47:22.293147 [debug] [ThreadPool]: SQL status: OK in 0.107 seconds
[0m07:47:22.294653 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m07:47:22.295658 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m07:47:22.295658 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m07:47:22.301434 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:47:22.301434 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m07:47:22.301434 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m07:47:22.301434 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m07:47:22.303855 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:47:22.303855 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m07:47:22.304372 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:47:22.304372 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:47:22.304966 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m07:47:22.304966 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:47:22.304966 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:47:22.305977 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:47:22.305977 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:47:22.306486 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:47:22.306486 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m07:47:22.308246 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m07:47:22.312593 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:47:22.312593 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m07:47:22.313810 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:47:22.313810 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:47:22.313810 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:47:22.313810 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m07:47:22.325033 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m07:47:22.326041 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m07:47:22.327047 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m07:47:22.327552 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m07:47:22.330975 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9E96C60>]}
[0m07:47:22.330975 [debug] [MainThread]: Using duckdb connection "master"
[0m07:47:22.330975 [debug] [MainThread]: On master: BEGIN
[0m07:47:22.330975 [debug] [MainThread]: Opening a new connection, currently in state init
[0m07:47:22.332279 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:47:22.332279 [debug] [MainThread]: On master: COMMIT
[0m07:47:22.332279 [debug] [MainThread]: Using duckdb connection "master"
[0m07:47:22.332279 [debug] [MainThread]: On master: COMMIT
[0m07:47:22.332279 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:47:22.333293 [debug] [MainThread]: On master: Close
[0m07:47:22.336014 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m07:47:22.336014 [info ] [Thread-1 (]: 1 of 87 START sql table model main.dim_atividade ............................... [RUN]
[0m07:47:22.337939 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_atividade'
[0m07:47:22.337939 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m07:47:22.342793 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.344397 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m07:47:22.369066 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.369066 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.370684 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m07:47:22.370684 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m07:47:22.371544 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.371544 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.371544 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m07:47:22.372275 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.376855 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.376855 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_atividade'
  
[0m07:47:22.379967 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:47:22.381073 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.381073 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_atividade'
  
[0m07:47:22.382005 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.387517 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.387517 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade" rename to "dim_atividade__dbt_backup"
[0m07:47:22.388022 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.390535 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.390535 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m07:47:22.390535 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.401029 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m07:47:22.401029 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.401029 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m07:47:22.403766 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:22.408235 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:47:22.408235 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m07:47:22.408235 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.410979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m07:47:22.412485 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9F344D0>]}
[0m07:47:22.413966 [info ] [Thread-1 (]: 1 of 87 OK created sql table model main.dim_atividade .......................... [[32mOK[0m in 0.07s]
[0m07:47:22.414980 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m07:47:22.416001 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:47:22.416001 [info ] [Thread-1 (]: 2 of 87 START sql table model main.dim_classe_instituicao ...................... [RUN]
[0m07:47:22.417153 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m07:47:22.417659 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:47:22.419668 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.420668 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:47:22.422689 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.423694 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.424260 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m07:47:22.424935 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:22.424935 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.425580 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.425580 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m07:47:22.426102 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.427619 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.427619 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:47:22.428624 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.429625 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.430130 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:47:22.430644 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.432740 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.433746 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao" rename to "dim_classe_instituicao__dbt_backup"
[0m07:47:22.433746 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.435744 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.436746 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m07:47:22.436746 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.438256 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:47:22.438256 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.438256 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:47:22.439762 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.442088 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:47:22.443092 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m07:47:22.444093 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.445603 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m07:47:22.446383 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9B01A90>]}
[0m07:47:22.446383 [info ] [Thread-1 (]: 2 of 87 OK created sql table model main.dim_classe_instituicao ................. [[32mOK[0m in 0.03s]
[0m07:47:22.448478 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:47:22.448841 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:47:22.449483 [info ] [Thread-1 (]: 3 of 87 START sql table model main.dim_consolidado ............................. [RUN]
[0m07:47:22.450483 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m07:47:22.450483 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m07:47:22.453370 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.453901 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m07:47:22.458048 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.458723 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.459738 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m07:47:22.460242 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:22.460242 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.461560 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.462064 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m07:47:22.462910 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.464022 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.464022 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:47:22.464022 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.465534 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.466037 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:47:22.466037 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.469570 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.469570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m07:47:22.470553 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.473926 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.474541 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m07:47:22.474541 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.475573 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:47:22.475573 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.475573 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:47:22.477690 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.480407 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:47:22.480969 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m07:47:22.482676 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.484363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m07:47:22.484884 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EBF63140>]}
[0m07:47:22.485407 [info ] [Thread-1 (]: 3 of 87 OK created sql table model main.dim_consolidado ........................ [[32mOK[0m in 0.04s]
[0m07:47:22.485967 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:47:22.486597 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m07:47:22.487584 [info ] [Thread-1 (]: 4 of 87 START sql table model main.dim_controle ................................ [RUN]
[0m07:47:22.488907 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m07:47:22.489443 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m07:47:22.492073 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.492073 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m07:47:22.496169 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.498692 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.498692 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m07:47:22.498692 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:22.498692 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.500467 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.501080 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m07:47:22.501080 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.503300 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.503300 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:47:22.503300 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.504958 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.505613 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:47:22.505613 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.508561 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.509065 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m07:47:22.509573 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.511961 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.512506 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m07:47:22.512506 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.514092 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:47:22.514092 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.514690 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:47:22.516803 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.518644 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:47:22.518644 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m07:47:22.519693 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.521172 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m07:47:22.521713 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9AD3E30>]}
[0m07:47:22.522228 [info ] [Thread-1 (]: 4 of 87 OK created sql table model main.dim_controle ........................... [[32mOK[0m in 0.03s]
[0m07:47:22.522784 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m07:47:22.523405 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:47:22.524051 [info ] [Thread-1 (]: 5 of 87 START sql table model main.dim_faixa_vencimento ........................ [RUN]
[0m07:47:22.524588 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m07:47:22.525106 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:47:22.528318 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.528318 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:47:22.532769 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.533840 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.533840 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m07:47:22.534371 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:22.535512 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.536049 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.536049 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m07:47:22.537720 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.540076 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.540637 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_faixa_vencimento'
  
[0m07:47:22.542842 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.543392 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.544407 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_faixa_vencimento'
  
[0m07:47:22.545474 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.549739 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.550252 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento" rename to "dim_faixa_vencimento__dbt_backup"
[0m07:47:22.550773 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.552845 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.553350 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m07:47:22.553350 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.555540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m07:47:22.556556 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.557061 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m07:47:22.558123 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.560309 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:47:22.560309 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m07:47:22.561958 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:22.563552 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m07:47:22.564093 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EBF95940>]}
[0m07:47:22.564093 [info ] [Thread-1 (]: 5 of 87 OK created sql table model main.dim_faixa_vencimento ................... [[32mOK[0m in 0.04s]
[0m07:47:22.565104 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:47:22.565627 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:47:22.566149 [info ] [Thread-1 (]: 6 of 87 START sql table model main.dim_instituicao ............................. [RUN]
[0m07:47:22.566149 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_instituicao)
[0m07:47:22.566934 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m07:47:22.575920 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:22.576927 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m07:47:22.579934 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:22.580439 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:22.580439 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m07:47:22.581947 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:22.582669 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:22.582669 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:22.583186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    md5(cast(cast(codigo_origem as bigint) as varchar))
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
QUALIFY row_number() OVER (PARTITION BY codigo_origem ORDER BY tipo_instituicao) = 1
    );
  
  
[0m07:47:23.018796 [debug] [Thread-1 (]: SQL status: OK in 0.435 seconds
[0m07:47:23.020302 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:23.021308 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:47:23.021814 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.022321 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:23.023328 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:47:23.023833 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.025859 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:23.025859 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m07:47:23.026864 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.028872 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:23.028872 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m07:47:23.029870 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.030376 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:47:23.030376 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:23.030376 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:47:23.037683 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:47:23.040201 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:47:23.040201 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m07:47:23.041712 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.042722 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m07:47:23.042722 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9E562D0>]}
[0m07:47:23.042722 [info ] [Thread-1 (]: 6 of 87 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.48s]
[0m07:47:23.044229 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:47:23.044229 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:47:23.044229 [info ] [Thread-1 (]: 7 of 87 START sql table model main.dim_localizacao ............................. [RUN]
[0m07:47:23.045233 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m07:47:23.045233 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m07:47:23.048812 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.049819 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m07:47:23.052840 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.052840 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.054366 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m07:47:23.054772 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:23.055278 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.055790 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.055790 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m07:47:23.091874 [debug] [Thread-1 (]: SQL status: OK in 0.035 seconds
[0m07:47:23.092897 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.092897 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:47:23.093893 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.093893 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.093893 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:47:23.095493 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.097522 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.097522 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m07:47:23.098736 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.100277 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.100277 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m07:47:23.101295 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.102315 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:47:23.102315 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.102315 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:47:23.104401 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:23.106495 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:47:23.106495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m07:47:23.107536 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.108166 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m07:47:23.108166 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9F164E0>]}
[0m07:47:23.108166 [info ] [Thread-1 (]: 7 of 87 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.06s]
[0m07:47:23.109852 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:47:23.109852 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m07:47:23.110866 [info ] [Thread-1 (]: 8 of 87 START sql table model main.dim_porte ................................... [RUN]
[0m07:47:23.110866 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_porte)
[0m07:47:23.110866 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m07:47:23.113463 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.114080 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m07:47:23.117131 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.118138 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.118138 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m07:47:23.118138 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:23.119139 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.119139 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.119139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m07:47:23.120645 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.121238 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.121922 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_porte'
  
[0m07:47:23.121922 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.122928 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.123929 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_porte'
  
[0m07:47:23.124433 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.126945 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.127953 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte" rename to "dim_porte__dbt_backup"
[0m07:47:23.127953 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.130097 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.131103 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m07:47:23.131834 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.132851 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m07:47:23.133360 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.133360 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m07:47:23.134361 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.135379 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:47:23.136377 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m07:47:23.137362 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.137931 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m07:47:23.137931 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9E56210>]}
[0m07:47:23.137931 [info ] [Thread-1 (]: 8 of 87 OK created sql table model main.dim_porte .............................. [[32mOK[0m in 0.03s]
[0m07:47:23.139494 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m07:47:23.139494 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:47:23.140500 [info ] [Thread-1 (]: 9 of 87 START sql table model main.dim_produto_credito ......................... [RUN]
[0m07:47:23.140500 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m07:47:23.141502 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:47:23.144519 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.145524 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:47:23.148557 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.148557 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.150186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m07:47:23.150186 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:23.150186 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.151192 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.151192 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m07:47:23.152703 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.153338 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.153338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_produto_credito'
  
[0m07:47:23.154842 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.155985 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.155985 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_produto_credito'
  
[0m07:47:23.156534 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.158685 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.158685 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito" rename to "dim_produto_credito__dbt_backup"
[0m07:47:23.159722 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.162372 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.162877 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m07:47:23.163425 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.164008 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m07:47:23.164008 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.165022 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m07:47:23.166098 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.168139 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:47:23.168139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m07:47:23.169115 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.169115 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m07:47:23.170623 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9E564B0>]}
[0m07:47:23.171264 [info ] [Thread-1 (]: 9 of 87 OK created sql table model main.dim_produto_credito .................... [[32mOK[0m in 0.03s]
[0m07:47:23.171904 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:47:23.171904 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m07:47:23.171904 [info ] [Thread-1 (]: 10 of 87 START sql table model main.dim_regiao ................................. [RUN]
[0m07:47:23.173517 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m07:47:23.173517 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m07:47:23.175389 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.176986 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m07:47:23.179556 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.180147 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.181152 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m07:47:23.181152 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:23.182192 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.182192 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.182192 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m07:47:23.183282 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.184280 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.184280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_regiao'
  
[0m07:47:23.185279 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.186264 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.186264 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_regiao'
  
[0m07:47:23.187265 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.189461 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.189461 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao" rename to "dim_regiao__dbt_backup"
[0m07:47:23.190490 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.192080 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.193086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m07:47:23.193086 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.194590 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m07:47:23.194590 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.195616 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m07:47:23.195616 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.198922 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:47:23.198922 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m07:47:23.200465 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.201084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m07:47:23.201084 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9F13EF0>]}
[0m07:47:23.201084 [info ] [Thread-1 (]: 10 of 87 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.03s]
[0m07:47:23.202656 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m07:47:23.203296 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m07:47:23.203296 [info ] [Thread-1 (]: 11 of 87 START sql table model main.dim_risco .................................. [RUN]
[0m07:47:23.204301 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m07:47:23.204301 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m07:47:23.205415 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.207130 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m07:47:23.209822 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.210897 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.210897 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m07:47:23.210897 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:23.210897 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.212413 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.212413 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m07:47:23.213419 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.214235 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.214938 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_risco'
  
[0m07:47:23.216117 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.217124 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.217124 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_risco'
  
[0m07:47:23.217630 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.219636 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.220636 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco" rename to "dim_risco__dbt_backup"
[0m07:47:23.221824 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.226082 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.226082 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m07:47:23.226082 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.227593 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m07:47:23.228600 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.229599 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m07:47:23.231116 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.232620 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:47:23.233624 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m07:47:23.234624 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.235628 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m07:47:23.235628 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9E56930>]}
[0m07:47:23.236627 [info ] [Thread-1 (]: 11 of 87 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.03s]
[0m07:47:23.237626 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m07:47:23.237626 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m07:47:23.238664 [info ] [Thread-1 (]: 12 of 87 START sql table model main.dim_segmento ............................... [RUN]
[0m07:47:23.239167 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m07:47:23.239709 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m07:47:23.241941 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.242556 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m07:47:23.245621 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.246626 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.246626 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m07:47:23.247628 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:23.248646 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.248646 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.250195 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m07:47:23.251240 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.253038 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.253038 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:47:23.254563 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.257123 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.257636 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:47:23.258215 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.262469 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.263635 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m07:47:23.263635 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.271507 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.272516 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m07:47:23.273536 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.275561 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:47:23.275561 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.277137 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:47:23.278145 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.281940 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:47:23.282948 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m07:47:23.283946 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.285949 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m07:47:23.285949 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EC017D40>]}
[0m07:47:23.287473 [info ] [Thread-1 (]: 12 of 87 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.05s]
[0m07:47:23.288224 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m07:47:23.289231 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m07:47:23.289231 [info ] [Thread-1 (]: 13 of 87 START sql table model main.dim_tempo .................................. [RUN]
[0m07:47:23.290232 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now model.bacen_ifdata_analytics.dim_tempo)
[0m07:47:23.290232 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m07:47:23.301587 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.303884 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m07:47:23.308051 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.310075 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.310075 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m07:47:23.311085 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:23.311085 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.311085 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.312591 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m07:47:23.378295 [debug] [Thread-1 (]: SQL status: OK in 0.065 seconds
[0m07:47:23.379805 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.379805 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:47:23.380816 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.381885 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.382893 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:47:23.383894 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.385892 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.387398 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m07:47:23.388009 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.390658 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.390658 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m07:47:23.391658 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:23.392164 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:47:23.393170 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.393170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:47:23.394171 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.397749 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:47:23.397749 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m07:47:23.398932 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.400477 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m07:47:23.401098 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9955FA0>]}
[0m07:47:23.401098 [info ] [Thread-1 (]: 13 of 87 OK created sql table model main.dim_tempo ............................. [[32mOK[0m in 0.11s]
[0m07:47:23.402701 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m07:47:23.402701 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:47:23.403988 [info ] [Thread-1 (]: 14 of 87 START sql table model main.fato_balanco_patrimonial ................... [RUN]
[0m07:47:23.404997 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m07:47:23.404997 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:47:23.409824 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:23.410840 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:47:23.417989 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:23.420269 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:23.421320 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m07:47:23.421320 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:23.422330 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:23.424338 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:23.425349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        a.* EXCLUDE (codigo, data_base),
        l.* EXCLUDE (codigo, data_base),
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        deposito_total as depositos,
        "obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        "outras_obrigações" as outras_obrigacoes,
        "passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        a.* EXCLUDE (codigo, data_base),
        l.* EXCLUDE (codigo, data_base),
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        deposito_total as depositos,
        obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        a.* EXCLUDE (codigo, data_base),
        l.* EXCLUDE (codigo, data_base),
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        deposito_total as depositos,
        obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m07:47:23.957524 [debug] [Thread-1 (]: SQL status: OK in 0.529 seconds
[0m07:47:23.958555 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:23.958555 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m07:47:23.960085 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.013957 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:24.013957 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m07:47:24.015472 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:24.018491 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:24.019492 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial" rename to "fato_balanco_patrimonial__dbt_backup"
[0m07:47:24.019492 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.022146 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:24.022146 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m07:47:24.023703 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:24.026811 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:47:24.026811 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:24.026811 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:47:24.183035 [debug] [Thread-1 (]: SQL status: OK in 0.155 seconds
[0m07:47:24.186057 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:47:24.186057 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m07:47:24.188166 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:24.189699 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m07:47:24.189699 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EC025340>]}
[0m07:47:24.190731 [info ] [Thread-1 (]: 14 of 87 OK created sql table model main.fato_balanco_patrimonial .............. [[32mOK[0m in 0.79s]
[0m07:47:24.190731 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:47:24.191715 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:47:24.191715 [info ] [Thread-1 (]: 15 of 87 START sql table model main.fato_capital_prudencial .................... [RUN]
[0m07:47:24.191715 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m07:47:24.193160 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:47:24.195841 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.195841 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:47:24.198533 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.198533 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.200177 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m07:47:24.200177 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:24.200799 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:24.200799 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.200799 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m07:47:24.386100 [debug] [Thread-1 (]: SQL status: OK in 0.185 seconds
[0m07:47:24.388274 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.388274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_capital_prudencial'
  
[0m07:47:24.389312 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.389961 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.389961 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_capital_prudencial'
  
[0m07:47:24.391008 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.393096 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.393096 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial" rename to "fato_capital_prudencial__dbt_backup"
[0m07:47:24.394096 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.395829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.395829 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m07:47:24.395829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.397461 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m07:47:24.397461 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.398489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m07:47:24.429792 [debug] [Thread-1 (]: SQL status: OK in 0.031 seconds
[0m07:47:24.431998 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:47:24.433028 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m07:47:24.435731 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:24.437901 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m07:47:24.437901 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EBFAE090>]}
[0m07:47:24.437901 [info ] [Thread-1 (]: 15 of 87 OK created sql table model main.fato_capital_prudencial ............... [[32mOK[0m in 0.25s]
[0m07:47:24.439552 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:47:24.439552 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:47:24.440560 [info ] [Thread-1 (]: 16 of 87 START sql table model main.fato_carteira_credito_indexador ............ [RUN]
[0m07:47:24.440560 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m07:47:24.441563 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:47:24.446245 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.447751 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:47:24.454565 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.455576 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.457239 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m07:47:24.457747 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:24.458357 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:24.460380 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.461395 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m07:47:24.510496 [debug] [Thread-1 (]: SQL status: OK in 0.048 seconds
[0m07:47:24.511526 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.511526 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_indexador'
  
[0m07:47:24.512524 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.513941 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.513941 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_indexador'
  
[0m07:47:24.514954 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:24.516700 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.517706 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador" rename to "fato_carteira_credito_indexador__dbt_backup"
[0m07:47:24.517706 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.519707 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.519707 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m07:47:24.520707 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.521792 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m07:47:24.521792 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.522584 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m07:47:24.540656 [debug] [Thread-1 (]: SQL status: OK in 0.018 seconds
[0m07:47:24.542019 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:47:24.542019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m07:47:24.543985 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:24.545561 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m07:47:24.545561 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E98E81A0>]}
[0m07:47:24.545561 [info ] [Thread-1 (]: 16 of 87 OK created sql table model main.fato_carteira_credito_indexador ....... [[32mOK[0m in 0.11s]
[0m07:47:24.546599 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:47:24.546599 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:47:24.547597 [info ] [Thread-1 (]: 17 of 87 START sql table model main.fato_carteira_credito_totais ............... [RUN]
[0m07:47:24.548133 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m07:47:24.548133 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:47:24.551890 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.552415 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:47:24.554606 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.555639 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.556149 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m07:47:24.556670 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:24.556670 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:24.557684 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.557684 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m07:47:24.598693 [debug] [Thread-1 (]: SQL status: OK in 0.041 seconds
[0m07:47:24.600482 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.600482 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_totais'
  
[0m07:47:24.601565 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.601565 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.602665 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_totais'
  
[0m07:47:24.603218 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.605621 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.605621 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais" rename to "fato_carteira_credito_totais__dbt_backup"
[0m07:47:24.606630 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.609522 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.610057 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m07:47:24.610057 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.611093 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m07:47:24.611093 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.611093 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m07:47:24.710378 [debug] [Thread-1 (]: SQL status: OK in 0.098 seconds
[0m07:47:24.713554 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:47:24.713554 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m07:47:24.715127 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:24.716639 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m07:47:24.717144 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9F67230>]}
[0m07:47:24.717144 [info ] [Thread-1 (]: 17 of 87 OK created sql table model main.fato_carteira_credito_totais .......... [[32mOK[0m in 0.17s]
[0m07:47:24.718100 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:47:24.718100 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:47:24.719142 [info ] [Thread-1 (]: 18 of 87 START sql table model main.fato_demonstracao_resultado ................ [RUN]
[0m07:47:24.719142 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m07:47:24.719142 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:47:24.723660 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:24.724183 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:47:24.727009 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:24.727683 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:24.727683 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m07:47:24.728706 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:24.728706 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:24.728706 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:24.729705 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m07:47:25.337550 [debug] [Thread-1 (]: SQL status: OK in 0.608 seconds
[0m07:47:25.338765 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:25.339406 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_demonstracao_resultado'
  
[0m07:47:25.339406 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.340474 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:25.341516 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_demonstracao_resultado'
  
[0m07:47:25.342162 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.344274 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:25.344821 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado" rename to "fato_demonstracao_resultado__dbt_backup"
[0m07:47:25.345460 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.347570 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:25.348179 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m07:47:25.348781 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.350397 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:47:25.350397 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:25.350964 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:47:25.507548 [debug] [Thread-1 (]: SQL status: OK in 0.156 seconds
[0m07:47:25.509254 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:47:25.509254 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m07:47:25.511387 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:25.512404 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m07:47:25.513034 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EBF64D40>]}
[0m07:47:25.513678 [info ] [Thread-1 (]: 18 of 87 OK created sql table model main.fato_demonstracao_resultado ........... [[32mOK[0m in 0.79s]
[0m07:47:25.513678 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:47:25.514692 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:47:25.514692 [info ] [Thread-1 (]: 19 of 87 START sql table model main.fato_movimentacao_cambio ................... [RUN]
[0m07:47:25.514692 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m07:47:25.514692 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:47:25.518582 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.519582 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:47:25.521764 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.522340 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.522340 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m07:47:25.522340 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:25.523347 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.523852 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.523852 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m07:47:25.527875 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:47:25.528875 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.528875 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_movimentacao_cambio'
  
[0m07:47:25.530382 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.530382 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.530382 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_movimentacao_cambio'
  
[0m07:47:25.532616 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:25.536621 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.536621 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio" rename to "fato_movimentacao_cambio__dbt_backup"
[0m07:47:25.536621 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.539746 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.539746 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m07:47:25.541287 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.541870 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m07:47:25.541870 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.542875 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m07:47:25.548999 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:47:25.551361 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:47:25.552946 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m07:47:25.553951 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:25.555460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m07:47:25.555460 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EBF87CE0>]}
[0m07:47:25.555962 [info ] [Thread-1 (]: 19 of 87 OK created sql table model main.fato_movimentacao_cambio .............. [[32mOK[0m in 0.04s]
[0m07:47:25.557618 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:47:25.557618 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:47:25.558231 [info ] [Thread-1 (]: 20 of 87 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m07:47:25.559237 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m07:47:25.559237 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:47:25.562603 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.562603 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:47:25.568248 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.570225 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.570225 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m07:47:25.570729 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:25.570729 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.571293 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.571293 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m07:47:25.597462 [debug] [Thread-1 (]: SQL status: OK in 0.026 seconds
[0m07:47:25.598979 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.598979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_operacoes_clientes'
  
[0m07:47:25.599990 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.601109 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.601109 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_operacoes_clientes'
  
[0m07:47:25.601616 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.603198 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.604814 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes" rename to "fato_operacoes_clientes__dbt_backup"
[0m07:47:25.604814 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.607454 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.607454 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m07:47:25.607454 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.608974 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m07:47:25.609481 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.609481 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m07:47:25.615270 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:47:25.617967 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:47:25.617967 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m07:47:25.618946 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:25.620473 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m07:47:25.621080 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9F1D940>]}
[0m07:47:25.621080 [info ] [Thread-1 (]: 20 of 87 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.06s]
[0m07:47:25.621680 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:47:25.622229 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:47:25.622229 [info ] [Thread-1 (]: 21 of 87 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m07:47:25.622229 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m07:47:25.622229 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:47:25.625510 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.627224 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:47:25.630395 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.632905 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.632905 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m07:47:25.632905 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:25.633908 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.633908 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.633908 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    md5(cast(cast(d.codigo as bigint) as varchar))
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m07:47:25.910949 [debug] [Thread-1 (]: SQL status: OK in 0.277 seconds
[0m07:47:25.912456 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.912456 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m07:47:25.913018 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.913595 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.914614 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m07:47:25.914614 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.917221 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.917725 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m07:47:25.917725 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.920256 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.920256 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m07:47:25.921272 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:25.921935 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m07:47:25.921935 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:25.921935 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m07:47:26.092787 [debug] [Thread-1 (]: SQL status: OK in 0.170 seconds
[0m07:47:26.095809 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:47:26.095809 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m07:47:26.098360 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:26.099395 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m07:47:26.099395 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9F8A330>]}
[0m07:47:26.099917 [info ] [Thread-1 (]: 21 of 87 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.48s]
[0m07:47:26.101159 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:47:26.101159 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:47:26.101159 [info ] [Thread-1 (]: 22 of 87 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m07:47:26.102163 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m07:47:26.102668 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:47:26.108349 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:47:26.108349 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:47:26.122014 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:47:26.122556 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:47:26.123570 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m07:47:26.124076 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:26.124076 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:26.124713 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:47:26.124713 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m07:47:26.125326 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:26.127925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m07:47:26.128892 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m07:47:26.128892 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m07:47:26.129908 [info ] [Thread-1 (]: 22 of 87 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.03s]
[0m07:47:26.129908 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:47:26.131067 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:47:26.131067 [info ] [Thread-1 (]: 23 of 87 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m07:47:26.131067 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m07:47:26.132067 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:47:26.137234 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:47:26.137739 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:47:26.139747 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:47:26.141138 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:47:26.141645 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m07:47:26.141645 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:26.142279 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:26.142279 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:47:26.143294 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:47:26.145590 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:26.147101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m07:47:26.147606 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m07:47:26.147606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m07:47:26.148611 [info ] [Thread-1 (]: 23 of 87 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m07:47:26.148611 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:47:26.150224 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:47:26.150224 [info ] [Thread-1 (]: 24 of 87 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m07:47:26.151229 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m07:47:26.151229 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:47:26.155259 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:47:26.156825 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:47:26.159748 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:47:26.160322 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:47:26.161336 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m07:47:26.161336 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:26.161336 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:26.162841 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:47:26.162841 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m07:47:26.163936 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:26.164957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m07:47:26.164957 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m07:47:26.166031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m07:47:26.166031 [info ] [Thread-1 (]: 24 of 87 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m07:47:26.167049 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:47:26.167049 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:47:26.167049 [info ] [Thread-1 (]: 25 of 87 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m07:47:26.168233 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m07:47:26.169232 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:47:26.171416 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:47:26.173081 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:47:26.174593 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:47:26.176018 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:47:26.176018 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m07:47:26.177025 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:26.177528 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:26.177528 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:47:26.177528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:47:26.179534 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:26.181047 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m07:47:26.181047 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m07:47:26.182046 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m07:47:26.182046 [info ] [Thread-1 (]: 25 of 87 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m07:47:26.183357 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:47:26.183357 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:47:26.183357 [info ] [Thread-1 (]: 26 of 87 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m07:47:26.184356 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m07:47:26.184356 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:47:26.187960 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:47:26.187960 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:47:26.191629 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:47:26.194518 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:47:26.195524 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m07:47:26.197535 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:26.198560 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:26.200647 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:47:26.200647 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m07:47:26.202394 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:26.205539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m07:47:26.207979 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m07:47:26.207979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m07:47:26.208987 [info ] [Thread-1 (]: 26 of 87 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.02s]
[0m07:47:26.211091 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:47:26.212606 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:47:26.213619 [info ] [Thread-1 (]: 27 of 87 START test unique_dim_controle_id_controle ............................ [RUN]
[0m07:47:26.215738 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m07:47:26.215738 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:47:26.221403 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:47:26.223226 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:47:26.227483 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:47:26.228490 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:47:26.229496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m07:47:26.231071 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:26.232052 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:26.233363 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:47:26.233363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:47:26.236375 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:26.237979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m07:47:26.239717 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m07:47:26.240746 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m07:47:26.241749 [info ] [Thread-1 (]: 27 of 87 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.03s]
[0m07:47:26.242837 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:47:26.242837 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:47:26.244342 [info ] [Thread-1 (]: 28 of 87 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m07:47:26.244342 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m07:47:26.244342 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:47:26.251216 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:26.252812 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:47:26.257808 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:26.259660 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:26.260167 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m07:47:26.261173 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:26.262520 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:26.263043 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:26.263766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:47:34.216099 [debug] [Thread-1 (]: SQL status: OK in 7.952 seconds
[0m07:47:34.218584 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:34.218584 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_atividade'
  
[0m07:47:34.219578 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:34.220589 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:34.221201 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_atividade'
  
[0m07:47:34.221952 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:34.224214 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:34.224214 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade" rename to "fato_carteira_credito_atividade__dbt_backup"
[0m07:47:34.224789 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:34.227158 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:34.227158 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m07:47:34.227158 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:34.228164 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m07:47:34.228164 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:34.228164 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m07:47:34.362395 [debug] [Thread-1 (]: SQL status: OK in 0.133 seconds
[0m07:47:34.364615 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:47:34.364615 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m07:47:34.367214 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:34.367214 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m07:47:34.368294 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9E57170>]}
[0m07:47:35.171466 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m07:47:35.175469 [info ] [Thread-1 (]: 28 of 87 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 8.12s]
[0m07:47:35.178202 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:47:35.178202 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:47:35.180203 [info ] [Thread-1 (]: 29 of 87 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m07:47:35.180203 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m07:47:35.180203 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:47:35.184218 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:47:35.186129 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:47:35.187997 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:47:35.189000 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:47:35.189503 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m07:47:35.189503 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.189977 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.190507 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:47:35.190507 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:35.191508 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.193018 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m07:47:35.194018 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m07:47:35.194523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m07:47:35.194523 [info ] [Thread-1 (]: 29 of 87 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.01s]
[0m07:47:35.195527 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:47:35.195527 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:47:35.195527 [info ] [Thread-1 (]: 30 of 87 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m07:47:35.196570 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m07:47:35.196570 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:47:35.199978 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:47:35.201492 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:47:35.204272 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:47:35.205468 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:47:35.205468 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m07:47:35.205468 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.206475 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.206980 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:47:35.206980 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:47:35.207485 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.208491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m07:47:35.209864 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m07:47:35.209864 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m07:47:35.209864 [info ] [Thread-1 (]: 30 of 87 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m07:47:35.210882 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:47:35.210882 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:47:35.210882 [info ] [Thread-1 (]: 31 of 87 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m07:47:35.212389 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m07:47:35.212934 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:47:35.216714 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:47:35.218413 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:47:35.220408 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:47:35.220910 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:47:35.221413 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m07:47:35.221413 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.221413 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.221413 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:47:35.221413 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:35.224329 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.225841 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m07:47:35.226844 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m07:47:35.226844 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m07:47:35.226844 [error] [Thread-1 (]: 31 of 87 FAIL 1 relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[31mFAIL 1[0m in 0.01s]
[0m07:47:35.227848 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:47:35.227848 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:47:35.228849 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0' to be skipped because of status 'fail'.  Reason: Got 1 result, configured to fail if != 0.
[0m07:47:35.228849 [info ] [Thread-1 (]: 32 of 87 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m07:47:35.229849 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m07:47:35.229849 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:47:35.235674 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:47:35.236675 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:47:35.238180 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:47:35.239186 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:47:35.239835 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m07:47:35.239835 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.239835 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.239835 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:47:35.239835 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:35.241978 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.242990 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m07:47:35.244006 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m07:47:35.244006 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m07:47:35.244006 [info ] [Thread-1 (]: 32 of 87 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m07:47:35.245701 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:47:35.245701 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:47:35.246708 [info ] [Thread-1 (]: 33 of 87 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m07:47:35.246708 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m07:47:35.247708 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:47:35.251158 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:47:35.251158 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:47:35.254697 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:47:35.255705 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:47:35.256211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m07:47:35.256715 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.256715 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.257239 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:47:35.257239 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:35.259255 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.260264 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m07:47:35.261269 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m07:47:35.261269 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m07:47:35.262268 [info ] [Thread-1 (]: 33 of 87 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m07:47:35.263095 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:47:35.263599 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:47:35.263599 [info ] [Thread-1 (]: 34 of 87 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m07:47:35.263599 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m07:47:35.263599 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:47:35.267836 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:47:35.268797 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:47:35.270300 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:47:35.271306 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:47:35.271306 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m07:47:35.271306 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.272528 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.272528 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:47:35.273055 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:47:35.275170 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:35.276175 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m07:47:35.277682 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m07:47:35.277682 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m07:47:35.277682 [info ] [Thread-1 (]: 34 of 87 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.01s]
[0m07:47:35.278689 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:47:35.278689 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:47:35.279690 [info ] [Thread-1 (]: 35 of 87 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m07:47:35.280194 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m07:47:35.280194 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:47:35.283741 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:47:35.284741 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:47:35.287805 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:47:35.287805 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:47:35.287805 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m07:47:35.289318 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.289900 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.289900 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:47:35.289900 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:47:35.289900 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.292045 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m07:47:35.293057 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m07:47:35.293057 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m07:47:35.293057 [info ] [Thread-1 (]: 35 of 87 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m07:47:35.294561 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:47:35.295567 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:47:35.295567 [info ] [Thread-1 (]: 36 of 87 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m07:47:35.296576 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m07:47:35.296576 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:47:35.301200 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:47:35.301705 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:47:35.304793 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:47:35.305378 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:47:35.305378 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m07:47:35.305378 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.307651 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.308347 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:47:35.308347 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:35.310831 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:35.312380 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m07:47:35.313645 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m07:47:35.313645 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m07:47:35.313645 [info ] [Thread-1 (]: 36 of 87 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m07:47:35.314657 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:47:35.314657 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:47:35.316339 [info ] [Thread-1 (]: 37 of 87 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m07:47:35.316339 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m07:47:35.316886 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:47:35.318904 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:47:35.320954 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:47:35.323338 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:47:35.324349 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:47:35.324349 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m07:47:35.324349 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.325413 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.325727 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:47:35.326230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:47:35.328293 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:35.330722 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m07:47:35.330722 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m07:47:35.330722 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m07:47:35.332332 [info ] [Thread-1 (]: 37 of 87 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m07:47:35.333340 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:47:35.334341 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:47:35.334341 [info ] [Thread-1 (]: 38 of 87 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m07:47:35.334341 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m07:47:35.334341 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:47:35.338505 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.339493 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:47:35.342901 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.342901 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.344408 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m07:47:35.344408 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.345418 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.345923 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.346427 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:47:35.498680 [debug] [Thread-1 (]: SQL status: OK in 0.152 seconds
[0m07:47:35.498680 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.500365 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_porte'
  
[0m07:47:35.500365 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.502374 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.502983 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_porte'
  
[0m07:47:35.502983 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.506829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.507456 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte" rename to "fato_carteira_credito_porte__dbt_backup"
[0m07:47:35.507456 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.510030 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.510030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m07:47:35.511054 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.511054 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m07:47:35.512579 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.512579 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m07:47:35.516778 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:47:35.518799 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:47:35.520389 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m07:47:35.521400 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:35.522447 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m07:47:35.522447 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9F0E210>]}
[0m07:47:35.522977 [info ] [Thread-1 (]: 38 of 87 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.19s]
[0m07:47:35.523482 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:47:35.524017 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:47:35.524591 [info ] [Thread-1 (]: 39 of 87 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m07:47:35.525167 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m07:47:35.525167 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:47:35.528736 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:35.528736 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:47:35.533005 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:35.534001 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:35.534001 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m07:47:35.534001 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:35.534988 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:35.534988 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:35.534988 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m07:47:47.672376 [debug] [Thread-1 (]: SQL status: OK in 12.136 seconds
[0m07:47:47.672948 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:47.673518 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_produto'
  
[0m07:47:47.674228 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:47.674920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:47.675513 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_produto'
  
[0m07:47:47.675513 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:47.678202 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:47.678202 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto" rename to "fato_carteira_credito_produto__dbt_backup"
[0m07:47:47.678202 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:47.680920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:47.681938 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m07:47:47.682562 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:47.682562 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m07:47:47.683676 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:47.683676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m07:47:47.732947 [debug] [Thread-1 (]: SQL status: OK in 0.049 seconds
[0m07:47:47.735687 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:47:47.735687 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m07:47:47.738007 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:47.739690 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m07:47:47.739690 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EC0494C0>]}
[0m07:47:47.740740 [info ] [Thread-1 (]: 39 of 87 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 12.22s]
[0m07:47:47.741741 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:47:47.741741 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:47:47.742349 [info ] [Thread-1 (]: 40 of 87 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m07:47:47.742349 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m07:47:47.743392 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:47:47.745670 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.746792 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:47:47.748347 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.750087 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.750712 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m07:47:47.750712 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:47.751329 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:47.751329 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.751329 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:47:47.981029 [debug] [Thread-1 (]: SQL status: OK in 0.228 seconds
[0m07:47:47.982594 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.982594 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_regiao_credito'
  
[0m07:47:47.983636 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:47.984691 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.984691 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_regiao_credito'
  
[0m07:47:47.985689 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:47.988840 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.988840 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito" rename to "fato_regiao_credito__dbt_backup"
[0m07:47:47.989401 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:47.992084 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.992084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m07:47:47.993189 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:47.994138 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m07:47:47.994138 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:47.994689 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m07:47:48.008766 [debug] [Thread-1 (]: SQL status: OK in 0.014 seconds
[0m07:47:48.011324 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:47:48.011324 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m07:47:48.012936 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.013802 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m07:47:48.013802 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153EBFBFF50>]}
[0m07:47:48.014916 [info ] [Thread-1 (]: 40 of 87 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.27s]
[0m07:47:48.015481 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:47:48.016021 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:47:48.016021 [info ] [Thread-1 (]: 41 of 87 START sql table model main.fato_risco_credito ......................... [RUN]
[0m07:47:48.017028 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m07:47:48.017535 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:47:48.021821 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.022518 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:47:48.025561 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.027253 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.027253 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m07:47:48.027253 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.028328 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.028328 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.028328 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:47:48.335119 [debug] [Thread-1 (]: SQL status: OK in 0.306 seconds
[0m07:47:48.336115 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.336115 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_risco_credito'
  
[0m07:47:48.336115 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.337659 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.337659 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_risco_credito'
  
[0m07:47:48.338775 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.341493 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.341493 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito" rename to "fato_risco_credito__dbt_backup"
[0m07:47:48.342092 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.344224 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.344224 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m07:47:48.344828 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.345428 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m07:47:48.346534 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.346534 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m07:47:48.418974 [debug] [Thread-1 (]: SQL status: OK in 0.072 seconds
[0m07:47:48.421027 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:47:48.421659 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m07:47:48.422250 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.423827 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m07:47:48.424767 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'a53e74a9-75f6-4304-a05e-0bb6ae1ea081', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E9F5F3B0>]}
[0m07:47:48.425484 [info ] [Thread-1 (]: 41 of 87 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.41s]
[0m07:47:48.425998 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:47:48.426530 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:47:48.427041 [info ] [Thread-1 (]: 42 of 87 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m07:47:48.427041 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m07:47:48.428061 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:47:48.430186 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:47:48.431228 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:47:48.433242 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:47:48.434241 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:47:48.434241 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m07:47:48.434241 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.435244 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.435244 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:47:48.435244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.436252 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.437766 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m07:47:48.438272 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m07:47:48.438272 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m07:47:48.439279 [info ] [Thread-1 (]: 42 of 87 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m07:47:48.440166 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:47:48.440670 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:47:48.441204 [info ] [Thread-1 (]: 43 of 87 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m07:47:48.442168 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m07:47:48.443180 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:47:48.446689 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:47:48.447689 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:47:48.451068 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:47:48.452071 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:47:48.452071 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m07:47:48.452574 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.453149 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.453149 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:47:48.453149 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.454657 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.456468 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m07:47:48.457475 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m07:47:48.457475 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m07:47:48.458082 [info ] [Thread-1 (]: 43 of 87 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m07:47:48.458809 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:47:48.459420 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:47:48.459420 [info ] [Thread-1 (]: 44 of 87 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m07:47:48.460047 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m07:47:48.460047 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:47:48.463566 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:47:48.465333 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:47:48.466840 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:47:48.467844 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:47:48.468848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m07:47:48.468848 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.468848 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.470697 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:47:48.470697 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:47:48.473119 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:48.474365 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m07:47:48.475388 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m07:47:48.475388 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m07:47:48.475388 [info ] [Thread-1 (]: 44 of 87 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m07:47:48.476987 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:47:48.477994 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:47:48.477994 [info ] [Thread-1 (]: 45 of 87 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m07:47:48.477994 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m07:47:48.477994 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:47:48.482234 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:47:48.483240 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:47:48.485245 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:47:48.486851 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:47:48.487360 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m07:47:48.487893 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.487893 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.487893 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:47:48.487893 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.489421 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.490428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m07:47:48.491430 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m07:47:48.491964 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m07:47:48.491964 [info ] [Thread-1 (]: 45 of 87 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m07:47:48.492981 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:47:48.492981 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:47:48.492981 [info ] [Thread-1 (]: 46 of 87 START test unique_dim_tempo_id_data ................................... [RUN]
[0m07:47:48.494486 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m07:47:48.494486 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:47:48.498743 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:47:48.498743 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:47:48.500929 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:47:48.503210 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:47:48.504270 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m07:47:48.504270 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.505444 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.506454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:47:48.506454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:47:48.508400 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:48.510358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m07:47:48.511363 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m07:47:48.511363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m07:47:48.512402 [info ] [Thread-1 (]: 46 of 87 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m07:47:48.513062 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:47:48.513062 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:47:48.513062 [info ] [Thread-1 (]: 47 of 87 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m07:47:48.514612 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m07:47:48.514612 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:47:48.517679 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:47:48.519374 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:47:48.521389 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:47:48.522395 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:47:48.522395 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m07:47:48.522900 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.523404 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.523984 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:47:48.524531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.526070 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.527076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m07:47:48.528083 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m07:47:48.528083 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m07:47:48.528083 [info ] [Thread-1 (]: 47 of 87 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.01s]
[0m07:47:48.529586 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:47:48.530147 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:47:48.530147 [info ] [Thread-1 (]: 48 of 87 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m07:47:48.531154 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m07:47:48.531154 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:47:48.534860 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:47:48.535839 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:47:48.539638 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:47:48.541643 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:47:48.542303 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m07:47:48.542303 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.543306 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.543306 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:47:48.544309 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.544309 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.545458 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m07:47:48.546634 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m07:47:48.546634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m07:47:48.547608 [info ] [Thread-1 (]: 48 of 87 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m07:47:48.548112 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:47:48.548617 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:47:48.549320 [info ] [Thread-1 (]: 49 of 87 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:47:48.549320 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m07:47:48.550359 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:47:48.554714 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:47:48.555718 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:47:48.557727 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:47:48.558424 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:47:48.558424 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m07:47:48.558424 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.559577 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.560208 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:47:48.560208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.565268 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:47:48.566272 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m07:47:48.568553 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m07:47:48.568553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m07:47:48.568553 [info ] [Thread-1 (]: 49 of 87 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:47:48.569553 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:47:48.570573 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:47:48.571101 [info ] [Thread-1 (]: 50 of 87 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:47:48.571742 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m07:47:48.572455 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:47:48.577945 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:47:48.580090 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:47:48.582259 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:47:48.583265 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:47:48.584264 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m07:47:48.584264 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.585268 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.585268 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:47:48.585268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.595882 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m07:47:48.598504 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m07:47:48.600129 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m07:47:48.600770 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m07:47:48.601325 [info ] [Thread-1 (]: 50 of 87 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:47:48.601325 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:47:48.602999 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:47:48.602999 [info ] [Thread-1 (]: 51 of 87 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m07:47:48.604005 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m07:47:48.604568 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:47:48.606789 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:47:48.608669 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:47:48.612050 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:47:48.612565 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:47:48.612565 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m07:47:48.613572 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.614077 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.614077 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:47:48.615080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.616087 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.617235 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m07:47:48.618243 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m07:47:48.618243 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m07:47:48.619243 [info ] [Thread-1 (]: 51 of 87 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.02s]
[0m07:47:48.619243 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:47:48.619243 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:47:48.620750 [info ] [Thread-1 (]: 52 of 87 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m07:47:48.621367 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m07:47:48.621367 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:47:48.624695 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:47:48.625319 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:47:48.627329 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:47:48.628861 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:47:48.629869 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m07:47:48.630374 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.631381 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.631381 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:47:48.632534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.633538 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.634541 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m07:47:48.635541 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m07:47:48.635541 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m07:47:48.636541 [info ] [Thread-1 (]: 52 of 87 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m07:47:48.637191 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:47:48.637191 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:47:48.638292 [info ] [Thread-1 (]: 53 of 87 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:47:48.638292 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m07:47:48.639306 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:47:48.646814 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:47:48.647811 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:47:48.650331 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:47:48.650892 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:47:48.652486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m07:47:48.652486 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.653053 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.653053 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:47:48.653053 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.656737 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:48.658950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m07:47:48.659501 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m07:47:48.660186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m07:47:48.660186 [info ] [Thread-1 (]: 53 of 87 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:47:48.661197 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:47:48.661197 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:47:48.661197 [info ] [Thread-1 (]: 54 of 87 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:47:48.661197 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m07:47:48.662699 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:47:48.666430 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:47:48.666986 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:47:48.668996 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:47:48.668996 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:47:48.668996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m07:47:48.670499 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.671121 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.671671 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:47:48.671671 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.677000 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:47:48.679510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m07:47:48.681111 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m07:47:48.681111 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m07:47:48.682128 [info ] [Thread-1 (]: 54 of 87 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:47:48.683227 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:47:48.683227 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:47:48.683227 [info ] [Thread-1 (]: 55 of 87 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m07:47:48.684229 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m07:47:48.685208 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:47:48.689747 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:47:48.690750 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:47:48.692799 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:47:48.694339 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:47:48.695348 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m07:47:48.695348 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.695854 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.695854 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:47:48.695854 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.696858 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.698361 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m07:47:48.700036 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m07:47:48.700706 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m07:47:48.701304 [info ] [Thread-1 (]: 55 of 87 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.02s]
[0m07:47:48.702334 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:47:48.702842 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:47:48.703383 [info ] [Thread-1 (]: 56 of 87 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m07:47:48.704480 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m07:47:48.704480 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:47:48.708606 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:47:48.708606 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:47:48.711194 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:47:48.713308 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:47:48.713308 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m07:47:48.713973 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.713973 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.713973 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:47:48.715004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.715534 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.717085 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m07:47:48.718759 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m07:47:48.718759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m07:47:48.718759 [info ] [Thread-1 (]: 56 of 87 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m07:47:48.720277 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:47:48.720277 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:47:48.721286 [info ] [Thread-1 (]: 57 of 87 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:47:48.721792 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m07:47:48.721792 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:47:48.725468 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:47:48.725468 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:47:48.729532 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:47:48.730140 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:47:48.731144 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m07:47:48.731144 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.732144 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.732144 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:47:48.732144 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.735761 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:47:48.737267 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m07:47:48.737854 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m07:47:48.737854 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m07:47:48.737854 [info ] [Thread-1 (]: 57 of 87 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:47:48.739489 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:47:48.740494 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:47:48.741495 [info ] [Thread-1 (]: 58 of 87 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:47:48.742122 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m07:47:48.742122 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:47:48.748658 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:47:48.749966 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:47:48.751545 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:47:48.752567 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:47:48.753145 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m07:47:48.753145 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.754150 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.754656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:47:48.755663 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.762612 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:47:48.764690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m07:47:48.766318 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m07:47:48.766891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m07:47:48.767904 [info ] [Thread-1 (]: 58 of 87 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:47:48.768907 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:47:48.768907 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:47:48.768907 [info ] [Thread-1 (]: 59 of 87 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m07:47:48.770414 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m07:47:48.770414 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:47:48.772179 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:47:48.774522 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:47:48.775535 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:47:48.777176 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:47:48.778188 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m07:47:48.778188 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.778188 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.778188 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:47:48.778188 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.779709 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.781222 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m07:47:48.782242 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m07:47:48.782242 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m07:47:48.783454 [info ] [Thread-1 (]: 59 of 87 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m07:47:48.783454 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:47:48.784438 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:47:48.784438 [info ] [Thread-1 (]: 60 of 87 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m07:47:48.785467 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m07:47:48.785467 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:47:48.789567 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:47:48.791583 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:47:48.794187 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:47:48.796738 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:47:48.796738 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m07:47:48.797746 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.798800 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.798800 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:47:48.799820 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.800955 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.802597 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m07:47:48.804227 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m07:47:48.804749 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m07:47:48.804749 [info ] [Thread-1 (]: 60 of 87 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.02s]
[0m07:47:48.805760 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:47:48.805760 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:47:48.805760 [info ] [Thread-1 (]: 61 of 87 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:47:48.806988 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m07:47:48.806988 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:47:48.810915 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:47:48.810915 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:47:48.814709 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:47:48.815214 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:47:48.815214 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m07:47:48.816220 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.816220 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.817226 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:47:48.817226 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.820360 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:47:48.822405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m07:47:48.822938 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m07:47:48.822938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m07:47:48.823945 [info ] [Thread-1 (]: 61 of 87 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:47:48.825108 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:47:48.825108 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:47:48.826132 [info ] [Thread-1 (]: 62 of 87 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:47:48.827112 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m07:47:48.827112 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:47:48.831953 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:47:48.833350 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:47:48.836366 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:47:48.837350 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:47:48.837855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m07:47:48.837855 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.837855 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.839446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:47:48.839446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.842071 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:47:48.844575 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m07:47:48.845580 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m07:47:48.846606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m07:47:48.847602 [info ] [Thread-1 (]: 62 of 87 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:47:48.848134 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:47:48.848656 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:47:48.848656 [info ] [Thread-1 (]: 63 of 87 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m07:47:48.848656 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m07:47:48.848656 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:47:48.853022 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:47:48.854595 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:47:48.855630 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:47:48.856793 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:47:48.857390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m07:47:48.857961 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.858584 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.859279 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:47:48.859279 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.860473 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.862501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m07:47:48.863552 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m07:47:48.863552 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m07:47:48.864081 [info ] [Thread-1 (]: 63 of 87 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.02s]
[0m07:47:48.865088 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:47:48.865088 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:47:48.866093 [info ] [Thread-1 (]: 64 of 87 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m07:47:48.866597 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m07:47:48.866597 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:47:48.869154 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:47:48.870154 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:47:48.871906 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:47:48.873538 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:47:48.874148 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m07:47:48.874148 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.874942 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.875454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:47:48.875454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.876526 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.877083 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m07:47:48.878112 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m07:47:48.878112 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m07:47:48.879639 [info ] [Thread-1 (]: 64 of 87 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m07:47:48.880315 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:47:48.880315 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:47:48.880315 [info ] [Thread-1 (]: 65 of 87 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:47:48.881881 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m07:47:48.881881 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:47:48.887995 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:47:48.890378 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:47:48.894422 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:47:48.895456 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:47:48.896536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m07:47:48.896536 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.896536 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.897536 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:47:48.897536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.902821 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:47:48.904963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m07:47:48.905471 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m07:47:48.906480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m07:47:48.907540 [info ] [Thread-1 (]: 65 of 87 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:47:48.908116 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:47:48.908730 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:47:48.908730 [info ] [Thread-1 (]: 66 of 87 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:47:48.909324 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m07:47:48.909324 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:47:48.913560 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:47:48.915211 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:47:48.917340 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:47:48.919344 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:47:48.919344 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m07:47:48.919344 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.920850 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.921372 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:47:48.921372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.928357 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:47:48.929878 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m07:47:48.930908 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m07:47:48.930908 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m07:47:48.931906 [info ] [Thread-1 (]: 66 of 87 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:47:48.931906 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:47:48.932957 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:47:48.932957 [info ] [Thread-1 (]: 67 of 87 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m07:47:48.932957 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m07:47:48.933957 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:47:48.939252 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:47:48.939798 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:47:48.942341 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:47:48.944362 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:47:48.944362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m07:47:48.944362 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.945535 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.945535 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:47:48.946072 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.946072 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.947577 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m07:47:48.948580 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m07:47:48.948580 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m07:47:48.948580 [info ] [Thread-1 (]: 67 of 87 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.02s]
[0m07:47:48.950185 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:47:48.950185 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:47:48.951215 [info ] [Thread-1 (]: 68 of 87 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m07:47:48.951825 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m07:47:48.951825 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:47:48.954840 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:47:48.955847 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:47:48.957928 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:47:48.959602 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:47:48.960109 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m07:47:48.960109 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.960109 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.961134 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:47:48.961134 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.961134 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.963652 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m07:47:48.964667 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m07:47:48.964667 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m07:47:48.966855 [info ] [Thread-1 (]: 68 of 87 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m07:47:48.967555 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:47:48.967555 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:47:48.967555 [info ] [Thread-1 (]: 69 of 87 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:47:48.968559 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m07:47:48.968559 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:47:48.972408 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:47:48.974530 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:47:48.975560 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:47:48.977528 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:47:48.978542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m07:47:48.978542 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.978542 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:48.978542 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:47:48.978542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:48.980063 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.982091 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m07:47:48.982600 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m07:47:48.983607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m07:47:48.983607 [info ] [Thread-1 (]: 69 of 87 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:47:48.984606 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:47:48.984606 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:47:48.985606 [info ] [Thread-1 (]: 70 of 87 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:47:48.986635 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m07:47:48.986635 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:47:48.992303 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:47:48.992837 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:47:48.995388 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:47:48.997297 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:47:48.997936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m07:47:48.997936 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:48.998963 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:48.999498 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:47:49.000019 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.002857 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:47:49.004395 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m07:47:49.005417 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m07:47:49.005417 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m07:47:49.005417 [info ] [Thread-1 (]: 70 of 87 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:47:49.007716 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:47:49.007716 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:47:49.008304 [info ] [Thread-1 (]: 71 of 87 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m07:47:49.008304 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m07:47:49.009308 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:47:49.012374 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:47:49.013134 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:47:49.018686 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:47:49.021189 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:47:49.021189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m07:47:49.022231 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.022231 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.022231 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:47:49.023794 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.025378 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.027394 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m07:47:49.028426 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m07:47:49.029140 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m07:47:49.029668 [info ] [Thread-1 (]: 71 of 87 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.02s]
[0m07:47:49.030256 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:47:49.030256 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:47:49.030256 [info ] [Thread-1 (]: 72 of 87 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m07:47:49.031792 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m07:47:49.031792 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:47:49.035814 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:47:49.037990 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:47:49.039713 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:47:49.041249 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:47:49.041249 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m07:47:49.041249 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.042276 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:49.042276 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:47:49.042276 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.043392 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.045906 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m07:47:49.047678 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m07:47:49.047678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m07:47:49.048701 [info ] [Thread-1 (]: 72 of 87 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m07:47:49.049232 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:47:49.050238 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:47:49.050238 [info ] [Thread-1 (]: 73 of 87 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:47:49.051242 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m07:47:49.051242 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:47:49.055395 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:47:49.056426 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:47:49.058804 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:47:49.060955 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:47:49.060955 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m07:47:49.060955 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.062852 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.062852 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:47:49.062852 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.065046 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:47:49.067116 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m07:47:49.067116 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m07:47:49.068149 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m07:47:49.068149 [info ] [Thread-1 (]: 73 of 87 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:47:49.068149 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:47:49.069655 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:47:49.069655 [info ] [Thread-1 (]: 74 of 87 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:47:49.070662 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m07:47:49.071166 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:47:49.074392 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:47:49.076692 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:47:49.078761 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:47:49.080550 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:47:49.080550 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m07:47:49.082247 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.082247 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.083273 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:47:49.083273 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.087850 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:47:49.089483 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m07:47:49.090517 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m07:47:49.090517 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m07:47:49.092026 [info ] [Thread-1 (]: 74 of 87 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:47:49.093030 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:47:49.093030 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:47:49.093030 [info ] [Thread-1 (]: 75 of 87 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m07:47:49.094535 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m07:47:49.094535 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:47:49.098634 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:47:49.101196 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:47:49.104663 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:47:49.105675 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:47:49.106757 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m07:47:49.106757 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.106757 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:49.107942 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:47:49.107942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.108681 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:49.110228 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m07:47:49.111241 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m07:47:49.111241 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m07:47:49.111241 [info ] [Thread-1 (]: 75 of 87 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.02s]
[0m07:47:49.112256 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:47:49.112974 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:47:49.113528 [info ] [Thread-1 (]: 76 of 87 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m07:47:49.114179 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m07:47:49.114757 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:47:49.119154 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:47:49.121361 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:47:49.127184 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:47:49.128213 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:47:49.129720 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m07:47:49.130371 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.130371 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.132005 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:47:49.132005 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.133033 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.134016 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m07:47:49.135033 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m07:47:49.135033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m07:47:49.136016 [info ] [Thread-1 (]: 76 of 87 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.02s]
[0m07:47:49.136016 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:47:49.136016 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:47:49.137520 [info ] [Thread-1 (]: 77 of 87 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:47:49.138556 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m07:47:49.138556 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:47:49.144168 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:47:49.144705 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:47:49.145229 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:47:49.146967 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:47:49.146967 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m07:47:49.147957 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.148539 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.148539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:47:49.148539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.154756 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:47:49.156426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m07:47:49.158089 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m07:47:49.158753 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m07:47:49.159766 [info ] [Thread-1 (]: 77 of 87 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:47:49.160271 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:47:49.160271 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:47:49.160271 [info ] [Thread-1 (]: 78 of 87 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:47:49.161297 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m07:47:49.161297 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:47:49.167191 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:47:49.168728 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:47:49.173452 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:47:49.175608 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:47:49.176138 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m07:47:49.176138 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.177160 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.178173 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:47:49.178173 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.188797 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m07:47:49.189798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m07:47:49.193118 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m07:47:49.193118 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m07:47:49.194186 [info ] [Thread-1 (]: 78 of 87 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:47:49.195322 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:47:49.195322 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:47:49.195322 [info ] [Thread-1 (]: 79 of 87 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m07:47:49.196375 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m07:47:49.196375 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:47:49.200115 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:47:49.200880 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:47:49.203423 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:47:49.204446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:47:49.204446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m07:47:49.204446 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.205459 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.205965 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:47:49.206484 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.207512 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.209710 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m07:47:49.210750 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m07:47:49.210750 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m07:47:49.212359 [info ] [Thread-1 (]: 79 of 87 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m07:47:49.213593 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:47:49.213593 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:47:49.213593 [info ] [Thread-1 (]: 80 of 87 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m07:47:49.214618 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m07:47:49.214618 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:47:49.218300 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:47:49.219305 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:47:49.221336 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:47:49.222888 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:47:49.222888 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m07:47:49.222888 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.223910 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.224538 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:47:49.224538 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.225565 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.228546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m07:47:49.230067 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m07:47:49.230067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m07:47:49.231095 [info ] [Thread-1 (]: 80 of 87 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m07:47:49.232085 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:47:49.233246 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:47:49.234269 [info ] [Thread-1 (]: 81 of 87 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m07:47:49.235262 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m07:47:49.235262 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:47:49.240064 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:47:49.241673 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:47:49.243227 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:47:49.244249 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:47:49.244249 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m07:47:49.244249 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.245261 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:49.245261 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:47:49.245261 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.246497 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:49.247493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m07:47:49.248836 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m07:47:49.248836 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m07:47:49.248836 [info ] [Thread-1 (]: 81 of 87 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.01s]
[0m07:47:49.251453 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:47:49.251453 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:47:49.252460 [info ] [Thread-1 (]: 82 of 87 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m07:47:49.252964 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m07:47:49.252964 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:47:49.256457 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:47:49.258144 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:47:49.259402 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:47:49.260442 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:47:49.260442 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m07:47:49.261620 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.261620 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.262616 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:47:49.263121 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.263673 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.266441 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m07:47:49.267168 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m07:47:49.267168 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m07:47:49.267168 [info ] [Thread-1 (]: 82 of 87 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.01s]
[0m07:47:49.268686 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:47:49.268686 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:47:49.269704 [info ] [Thread-1 (]: 83 of 87 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m07:47:49.270798 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m07:47:49.271418 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:47:49.275559 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:47:49.276181 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:47:49.278417 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:47:49.278417 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:47:49.280027 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m07:47:49.280027 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.280027 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:49.281033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:47:49.281033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.282035 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.283105 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m07:47:49.284195 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m07:47:49.284195 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m07:47:49.285130 [info ] [Thread-1 (]: 83 of 87 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.01s]
[0m07:47:49.286198 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:47:49.286198 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:47:49.286198 [info ] [Thread-1 (]: 84 of 87 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m07:47:49.287706 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m07:47:49.289216 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:47:49.294398 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:47:49.296123 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:47:49.301657 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:47:49.303171 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:47:49.303171 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m07:47:49.304351 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.305419 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.305419 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:47:49.305419 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.305419 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.307848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m07:47:49.308524 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m07:47:49.308524 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m07:47:49.310041 [info ] [Thread-1 (]: 84 of 87 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m07:47:49.311086 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:47:49.311086 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:47:49.311086 [info ] [Thread-1 (]: 85 of 87 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m07:47:49.312694 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m07:47:49.313155 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:47:49.317229 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:47:49.318236 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:47:49.322961 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:47:49.324294 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:47:49.325837 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m07:47:49.325837 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.327344 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.327344 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:47:49.328366 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.334523 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:47:49.336133 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m07:47:49.337650 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m07:47:49.338762 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m07:47:49.339798 [info ] [Thread-1 (]: 85 of 87 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.03s]
[0m07:47:49.339798 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:47:49.341365 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:47:49.341869 [info ] [Thread-1 (]: 86 of 87 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m07:47:49.342609 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m07:47:49.342609 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:47:49.347725 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:47:49.349914 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:47:49.353286 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:47:49.354330 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:47:49.354330 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m07:47:49.355453 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.355453 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:49.355453 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:47:49.355453 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.356529 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.358571 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m07:47:49.359583 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m07:47:49.360246 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m07:47:49.360246 [info ] [Thread-1 (]: 86 of 87 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.02s]
[0m07:47:49.361254 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:47:49.362254 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:47:49.362761 [info ] [Thread-1 (]: 87 of 87 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m07:47:49.363873 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m07:47:49.363873 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:47:49.368192 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:47:49.369221 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:47:49.371221 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:47:49.372659 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:47:49.372659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m07:47:49.372659 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:47:49.374212 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:47:49.374829 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:47:49.375418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m07:47:49.375418 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:47:49.377030 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m07:47:49.378046 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m07:47:49.378046 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m07:47:49.378046 [info ] [Thread-1 (]: 87 of 87 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m07:47:49.379556 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:47:49.381155 [debug] [MainThread]: Using duckdb connection "master"
[0m07:47:49.382151 [debug] [MainThread]: On master: BEGIN
[0m07:47:49.382656 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m07:47:49.382656 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m07:47:49.383663 [debug] [MainThread]: On master: COMMIT
[0m07:47:49.383663 [debug] [MainThread]: Using duckdb connection "master"
[0m07:47:49.384663 [debug] [MainThread]: On master: COMMIT
[0m07:47:49.384663 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:47:49.385663 [debug] [MainThread]: On master: Close
[0m07:47:49.385663 [debug] [MainThread]: Connection 'master' was properly closed.
[0m07:47:49.386664 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m07:47:49.386664 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m07:47:49.386664 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m07:47:49.387967 [info ] [MainThread]: 
[0m07:47:49.387967 [info ] [MainThread]: Finished running 26 table models, 61 data tests in 0 hours 0 minutes and 27.28 seconds (27.28s).
[0m07:47:49.395789 [debug] [MainThread]: Command end result
[0m07:47:49.439641 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:47:49.441669 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:47:49.448332 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m07:47:49.449943 [info ] [MainThread]: 
[0m07:47:49.450671 [info ] [MainThread]: [31mCompleted with 1 error, 0 partial successes, and 0 warnings:[0m
[0m07:47:49.451306 [info ] [MainThread]: 
[0m07:47:49.451306 [error] [MainThread]: [31mFailure in test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_ (models\gold\schema.yml)[0m
[0m07:47:49.451306 [error] [MainThread]:   Got 1 result, configured to fail if != 0
[0m07:47:49.452944 [info ] [MainThread]: 
[0m07:47:49.453950 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_dim_instituicao_b5bf1250f8e22e22ed6029d8a9776333.sql
[0m07:47:49.454455 [info ] [MainThread]: 
[0m07:47:49.454455 [info ] [MainThread]: Done. PASS=86 WARN=0 ERROR=1 SKIP=0 NO-OP=0 TOTAL=87
[0m07:47:49.455460 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 22 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m07:47:49.456472 [debug] [MainThread]: Command `dbt build` failed at 07:47:49.456472 after 29.67 seconds
[0m07:47:49.456472 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E8027A40>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E7788500>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000153E7C9BFB0>]}
[0m07:47:49.457640 [debug] [MainThread]: Flushing usage events
[0m07:47:50.084593 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m07:50:04.242507 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB44A20E90>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB44A22060>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB44A235C0>]}


============================== 07:50:04.251394 | 93b360bb-0012-4023-998b-dd56c4dea85b ==============================
[0m07:50:04.251394 [info ] [MainThread]: Running with dbt=1.11.5
[0m07:50:04.253059 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': '.', 'invocation_command': 'dbt build --select gold --profiles-dir .', 'use_colors': 'True', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m07:50:04.437235 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4695B680>]}
[0m07:50:04.484889 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4438FDA0>]}
[0m07:50:04.487420 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m07:50:04.668466 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m07:50:04.788749 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed.
[0m07:50:04.789271 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m07:50:05.046989 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m07:50:05.048014 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB472F5F40>]}
[0m07:50:05.158056 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m07:50:05.167758 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB472CA300>]}
[0m07:50:05.292908 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:50:05.295935 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:50:05.363643 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB46F118B0>]}
[0m07:50:05.363643 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m07:50:05.368053 [info ] [MainThread]: 
[0m07:50:05.368053 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m07:50:05.369053 [info ] [MainThread]: 
[0m07:50:05.369053 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m07:50:05.373380 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m07:50:05.436177 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m07:50:05.436177 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m07:50:05.436177 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:50:05.546405 [debug] [ThreadPool]: SQL status: OK in 0.110 seconds
[0m07:50:05.547426 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m07:50:05.548453 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m07:50:05.548453 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m07:50:05.553206 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:50:05.553206 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m07:50:05.553206 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m07:50:05.554739 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m07:50:05.555283 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:50:05.555283 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m07:50:05.555283 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:50:05.555283 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:50:05.555283 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m07:50:05.557043 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:50:05.557043 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:50:05.557722 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:50:05.557722 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:50:05.558264 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:50:05.558264 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m07:50:05.560541 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m07:50:05.564357 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:50:05.564984 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m07:50:05.564984 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:50:05.564984 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:50:05.564984 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:50:05.564984 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m07:50:05.575019 [debug] [ThreadPool]: SQL status: OK in 0.009 seconds
[0m07:50:05.577039 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m07:50:05.577039 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m07:50:05.577039 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m07:50:05.580532 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB471A0A70>]}
[0m07:50:05.582060 [debug] [MainThread]: Using duckdb connection "master"
[0m07:50:05.582060 [debug] [MainThread]: On master: BEGIN
[0m07:50:05.582060 [debug] [MainThread]: Opening a new connection, currently in state init
[0m07:50:05.582060 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:50:05.583073 [debug] [MainThread]: On master: COMMIT
[0m07:50:05.583073 [debug] [MainThread]: Using duckdb connection "master"
[0m07:50:05.583073 [debug] [MainThread]: On master: COMMIT
[0m07:50:05.583073 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:50:05.584073 [debug] [MainThread]: On master: Close
[0m07:50:05.586074 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m07:50:05.587596 [info ] [Thread-1 (]: 1 of 87 START sql table model main.dim_atividade ............................... [RUN]
[0m07:50:05.587596 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_atividade'
[0m07:50:05.587596 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m07:50:05.592828 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.594350 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m07:50:05.614695 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.616957 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.616957 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m07:50:05.616957 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m07:50:05.617973 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.617973 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.617973 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m07:50:05.618968 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.623552 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.624141 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_atividade'
  
[0m07:50:05.624742 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.625459 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.626176 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_atividade'
  
[0m07:50:05.626176 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.630829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.630829 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade" rename to "dim_atividade__dbt_backup"
[0m07:50:05.630829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.634338 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.634338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m07:50:05.635354 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.645170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m07:50:05.645170 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.645170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m07:50:05.646231 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.651320 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m07:50:05.651835 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m07:50:05.652841 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.654389 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m07:50:05.655404 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4240E360>]}
[0m07:50:05.656533 [info ] [Thread-1 (]: 1 of 87 OK created sql table model main.dim_atividade .......................... [[32mOK[0m in 0.07s]
[0m07:50:05.656533 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m07:50:05.657632 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:50:05.657632 [info ] [Thread-1 (]: 2 of 87 START sql table model main.dim_classe_instituicao ...................... [RUN]
[0m07:50:05.658810 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m07:50:05.658810 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:50:05.660907 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.660907 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:50:05.664023 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.665123 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.665123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m07:50:05.665667 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:05.666197 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.666197 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.666746 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m07:50:05.666746 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.667757 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.667757 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:50:05.668773 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.668773 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.670279 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:50:05.670279 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.672346 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.672346 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao" rename to "dim_classe_instituicao__dbt_backup"
[0m07:50:05.672346 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.675900 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.675900 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m07:50:05.675900 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.676912 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:50:05.677953 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.677953 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:50:05.677953 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.680182 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:50:05.681209 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m07:50:05.682192 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.683269 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m07:50:05.683269 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B7683E0>]}
[0m07:50:05.684284 [info ] [Thread-1 (]: 2 of 87 OK created sql table model main.dim_classe_instituicao ................. [[32mOK[0m in 0.03s]
[0m07:50:05.684284 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:50:05.685268 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:50:05.685268 [info ] [Thread-1 (]: 3 of 87 START sql table model main.dim_consolidado ............................. [RUN]
[0m07:50:05.686268 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m07:50:05.686268 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m07:50:05.687904 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.689510 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m07:50:05.692835 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.692835 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.694341 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m07:50:05.694341 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:05.695348 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.695348 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.695894 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m07:50:05.695894 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.697414 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.697414 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:50:05.697414 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.699123 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.699123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:50:05.700151 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.703271 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.704276 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m07:50:05.704781 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.707847 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.707847 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m07:50:05.708406 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.709967 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:50:05.709967 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.709967 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:50:05.711004 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.713519 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:50:05.713519 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m07:50:05.715030 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.716537 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m07:50:05.717108 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB46CA2450>]}
[0m07:50:05.718113 [info ] [Thread-1 (]: 3 of 87 OK created sql table model main.dim_consolidado ........................ [[32mOK[0m in 0.03s]
[0m07:50:05.718113 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:50:05.719112 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m07:50:05.719112 [info ] [Thread-1 (]: 4 of 87 START sql table model main.dim_controle ................................ [RUN]
[0m07:50:05.719112 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m07:50:05.720617 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m07:50:05.723567 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.724748 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m07:50:05.726917 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.727930 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.727930 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m07:50:05.727930 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:05.728932 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.729435 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.729435 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m07:50:05.729978 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.731226 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.731226 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:50:05.732248 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.732248 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.733282 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:50:05.733282 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.736277 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.736277 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m07:50:05.737588 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.739608 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.739608 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m07:50:05.739608 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.741249 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:50:05.741853 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.741853 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:50:05.742866 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.744370 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:50:05.745377 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m07:50:05.745883 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.747388 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m07:50:05.747388 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB47713B60>]}
[0m07:50:05.747388 [info ] [Thread-1 (]: 4 of 87 OK created sql table model main.dim_controle ........................... [[32mOK[0m in 0.03s]
[0m07:50:05.747388 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m07:50:05.749082 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:50:05.749082 [info ] [Thread-1 (]: 5 of 87 START sql table model main.dim_faixa_vencimento ........................ [RUN]
[0m07:50:05.750087 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m07:50:05.750087 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:50:05.754873 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.755391 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:50:05.758663 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.759223 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.759745 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m07:50:05.759745 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:05.760332 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.760904 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.760904 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m07:50:05.761987 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.763153 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.763153 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_faixa_vencimento'
  
[0m07:50:05.764253 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.766906 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.767875 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_faixa_vencimento'
  
[0m07:50:05.769419 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.772865 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.772865 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento" rename to "dim_faixa_vencimento__dbt_backup"
[0m07:50:05.773369 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.776987 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.777555 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m07:50:05.778164 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:05.779244 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m07:50:05.779756 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.779756 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m07:50:05.780834 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.783096 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m07:50:05.783096 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m07:50:05.784227 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.785362 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m07:50:05.786533 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB47713B90>]}
[0m07:50:05.787559 [info ] [Thread-1 (]: 5 of 87 OK created sql table model main.dim_faixa_vencimento ................... [[32mOK[0m in 0.04s]
[0m07:50:05.788028 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m07:50:05.788531 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:50:05.788531 [info ] [Thread-1 (]: 6 of 87 START sql table model main.dim_instituicao ............................. [RUN]
[0m07:50:05.789535 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_instituicao)
[0m07:50:05.789535 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m07:50:05.799660 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:05.801233 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m07:50:05.805533 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:05.807228 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:05.807228 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m07:50:05.807754 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:05.808268 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:05.808828 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:05.809369 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    md5(cast(cast(codigo_origem as bigint) as varchar))
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
QUALIFY row_number() OVER (PARTITION BY codigo_origem ORDER BY tipo_instituicao) = 1
    );
  
  
[0m07:50:06.286075 [debug] [Thread-1 (]: SQL status: OK in 0.477 seconds
[0m07:50:06.287579 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:06.287579 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:50:06.288584 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.289585 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:06.290091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:50:06.290091 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.292212 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:06.293218 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m07:50:06.293218 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.295739 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:06.295739 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m07:50:06.295739 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.298251 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:50:06.298251 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:06.298755 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:50:06.304802 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:50:06.307447 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:50:06.307447 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m07:50:06.308731 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.309387 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m07:50:06.309387 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B79BAD0>]}
[0m07:50:06.310501 [info ] [Thread-1 (]: 6 of 87 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.52s]
[0m07:50:06.311109 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:50:06.311109 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:50:06.311109 [info ] [Thread-1 (]: 7 of 87 START sql table model main.dim_localizacao ............................. [RUN]
[0m07:50:06.312624 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m07:50:06.312624 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m07:50:06.315169 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.316400 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m07:50:06.318216 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.319107 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.319107 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m07:50:06.319107 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:06.319107 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.320675 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.320675 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m07:50:06.382866 [debug] [Thread-1 (]: SQL status: OK in 0.062 seconds
[0m07:50:06.383890 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.383890 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:50:06.384886 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.385867 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.385867 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:50:06.385867 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.387924 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.389571 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m07:50:06.390284 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.392227 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.392227 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m07:50:06.393239 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.394255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:50:06.394255 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.394255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:50:06.395870 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:06.397373 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:50:06.397373 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m07:50:06.399208 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.400244 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m07:50:06.400244 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB46C3E870>]}
[0m07:50:06.400244 [info ] [Thread-1 (]: 7 of 87 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.09s]
[0m07:50:06.401396 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:50:06.401396 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m07:50:06.402199 [info ] [Thread-1 (]: 8 of 87 START sql table model main.dim_porte ................................... [RUN]
[0m07:50:06.402723 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_porte)
[0m07:50:06.402723 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m07:50:06.404603 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.406140 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m07:50:06.408165 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.408165 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.409826 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m07:50:06.409826 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:06.409826 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.410833 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.410833 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m07:50:06.410833 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.412338 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.413007 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_porte'
  
[0m07:50:06.413610 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.414134 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.414134 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_porte'
  
[0m07:50:06.415140 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.418664 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.418664 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte" rename to "dim_porte__dbt_backup"
[0m07:50:06.418664 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.421171 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.421849 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m07:50:06.422390 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.423907 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m07:50:06.424413 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.424413 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m07:50:06.425420 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.426933 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m07:50:06.427941 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m07:50:06.427941 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.430050 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m07:50:06.431060 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B7FF4D0>]}
[0m07:50:06.431060 [info ] [Thread-1 (]: 8 of 87 OK created sql table model main.dim_porte .............................. [[32mOK[0m in 0.03s]
[0m07:50:06.432057 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m07:50:06.432057 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:50:06.432057 [info ] [Thread-1 (]: 9 of 87 START sql table model main.dim_produto_credito ......................... [RUN]
[0m07:50:06.433394 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m07:50:06.433394 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:50:06.435395 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.438558 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:50:06.442309 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.443338 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.444323 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m07:50:06.444323 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:06.445429 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.445429 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.446587 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m07:50:06.447607 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.450322 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.450322 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_produto_credito'
  
[0m07:50:06.451868 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.454391 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.455400 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_produto_credito'
  
[0m07:50:06.456414 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.463950 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.464960 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito" rename to "dim_produto_credito__dbt_backup"
[0m07:50:06.466013 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.472812 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.473821 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m07:50:06.474406 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.476939 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m07:50:06.477951 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.478950 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m07:50:06.480497 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.485778 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m07:50:06.486780 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m07:50:06.489510 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:06.491524 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m07:50:06.492032 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB47713E60>]}
[0m07:50:06.493043 [info ] [Thread-1 (]: 9 of 87 OK created sql table model main.dim_produto_credito .................... [[32mOK[0m in 0.06s]
[0m07:50:06.495641 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m07:50:06.496667 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m07:50:06.496667 [info ] [Thread-1 (]: 10 of 87 START sql table model main.dim_regiao ................................. [RUN]
[0m07:50:06.498175 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m07:50:06.498175 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m07:50:06.504335 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.506884 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m07:50:06.513060 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.514784 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.515536 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m07:50:06.516551 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:06.518075 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.518075 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.519075 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m07:50:06.521192 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.522283 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.522283 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_regiao'
  
[0m07:50:06.523915 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.527189 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.527189 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_regiao'
  
[0m07:50:06.528793 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.532841 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.533851 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao" rename to "dim_regiao__dbt_backup"
[0m07:50:06.535390 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.539619 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.540654 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m07:50:06.540654 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.542265 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m07:50:06.542265 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.542265 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m07:50:06.544281 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.547620 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m07:50:06.548659 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m07:50:06.550269 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.551304 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m07:50:06.551304 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B83B470>]}
[0m07:50:06.551304 [info ] [Thread-1 (]: 10 of 87 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.05s]
[0m07:50:06.552863 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m07:50:06.552863 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m07:50:06.552863 [info ] [Thread-1 (]: 11 of 87 START sql table model main.dim_risco .................................. [RUN]
[0m07:50:06.555324 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m07:50:06.556979 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m07:50:06.560215 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.560742 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m07:50:06.564849 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.566426 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.566426 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m07:50:06.567086 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:06.568095 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.568095 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.569094 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m07:50:06.570600 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.571148 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.571868 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_risco'
  
[0m07:50:06.572481 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.573489 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.573489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_risco'
  
[0m07:50:06.574497 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.577023 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.577023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco" rename to "dim_risco__dbt_backup"
[0m07:50:06.578203 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.580267 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.580267 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m07:50:06.580267 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.581274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m07:50:06.581274 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.582274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m07:50:06.582782 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.584789 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m07:50:06.584789 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m07:50:06.585787 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.587297 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m07:50:06.587897 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB47713B00>]}
[0m07:50:06.587897 [info ] [Thread-1 (]: 11 of 87 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.03s]
[0m07:50:06.587897 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m07:50:06.589494 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m07:50:06.589494 [info ] [Thread-1 (]: 12 of 87 START sql table model main.dim_segmento ............................... [RUN]
[0m07:50:06.590504 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m07:50:06.590504 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m07:50:06.594081 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.595683 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m07:50:06.599274 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.600892 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.600892 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m07:50:06.600892 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:06.603125 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.604641 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.604641 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m07:50:06.606661 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.608057 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.608583 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:50:06.610206 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.611213 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.612214 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:50:06.612718 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.615322 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.615322 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m07:50:06.616349 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.618052 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.619030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m07:50:06.619030 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.620538 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:50:06.620538 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.621139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:50:06.621772 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.624704 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:50:06.625305 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m07:50:06.626317 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.627832 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m07:50:06.627832 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B7AE1E0>]}
[0m07:50:06.628838 [info ] [Thread-1 (]: 12 of 87 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.04s]
[0m07:50:06.629837 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m07:50:06.629837 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m07:50:06.630347 [info ] [Thread-1 (]: 13 of 87 START sql table model main.dim_tempo .................................. [RUN]
[0m07:50:06.630347 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now model.bacen_ifdata_analytics.dim_tempo)
[0m07:50:06.631857 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m07:50:06.644445 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.645459 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m07:50:06.648729 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.648729 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.650389 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m07:50:06.651021 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:06.651021 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.651021 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.653943 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m07:50:06.738057 [debug] [Thread-1 (]: SQL status: OK in 0.084 seconds
[0m07:50:06.739646 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.739646 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:50:06.740655 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.741656 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.742165 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:50:06.742165 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.744176 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.744176 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m07:50:06.745792 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.747953 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.748460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m07:50:06.748460 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:06.748460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:50:06.750087 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.750087 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:50:06.751248 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.754463 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:50:06.754463 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m07:50:06.755933 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.756537 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m07:50:06.757650 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B7CA3F0>]}
[0m07:50:06.757650 [info ] [Thread-1 (]: 13 of 87 OK created sql table model main.dim_tempo ............................. [[32mOK[0m in 0.13s]
[0m07:50:06.758345 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m07:50:06.758345 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:50:06.759350 [info ] [Thread-1 (]: 14 of 87 START sql table model main.fato_balanco_patrimonial ................... [RUN]
[0m07:50:06.759854 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m07:50:06.759854 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:50:06.764709 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:06.764709 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:50:06.767962 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:06.768966 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:06.768966 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m07:50:06.768966 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:06.768966 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:06.770475 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:06.771019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m07:50:07.313281 [debug] [Thread-1 (]: SQL status: OK in 0.542 seconds
[0m07:50:07.314287 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:07.314791 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m07:50:07.315297 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.316304 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:07.316304 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m07:50:07.317312 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.319319 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:07.319319 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial" rename to "fato_balanco_patrimonial__dbt_backup"
[0m07:50:07.320319 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.321683 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:07.322334 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m07:50:07.322839 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.323846 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:50:07.323846 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:07.324351 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:50:07.471112 [debug] [Thread-1 (]: SQL status: OK in 0.147 seconds
[0m07:50:07.472296 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:50:07.472296 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m07:50:07.475268 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:07.476832 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m07:50:07.476832 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB47708260>]}
[0m07:50:07.476832 [info ] [Thread-1 (]: 14 of 87 OK created sql table model main.fato_balanco_patrimonial .............. [[32mOK[0m in 0.72s]
[0m07:50:07.477863 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:50:07.478847 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:50:07.478847 [info ] [Thread-1 (]: 15 of 87 START sql table model main.fato_capital_prudencial .................... [RUN]
[0m07:50:07.479709 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m07:50:07.480232 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:50:07.482266 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.483274 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:50:07.485281 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.486280 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.486280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m07:50:07.487280 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:07.487785 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.487785 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.487785 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m07:50:07.652583 [debug] [Thread-1 (]: SQL status: OK in 0.164 seconds
[0m07:50:07.654255 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.654255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_capital_prudencial'
  
[0m07:50:07.655119 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:07.655816 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.656844 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_capital_prudencial'
  
[0m07:50:07.657376 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.660720 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.660720 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial" rename to "fato_capital_prudencial__dbt_backup"
[0m07:50:07.661725 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.722395 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.723040 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m07:50:07.723040 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.724546 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m07:50:07.725050 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.725050 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m07:50:07.785075 [debug] [Thread-1 (]: SQL status: OK in 0.061 seconds
[0m07:50:07.787635 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m07:50:07.787635 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m07:50:07.790385 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:07.791567 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m07:50:07.792144 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B789670>]}
[0m07:50:07.792144 [info ] [Thread-1 (]: 15 of 87 OK created sql table model main.fato_capital_prudencial ............... [[32mOK[0m in 0.31s]
[0m07:50:07.793188 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m07:50:07.793188 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:50:07.794157 [info ] [Thread-1 (]: 16 of 87 START sql table model main.fato_carteira_credito_indexador ............ [RUN]
[0m07:50:07.794157 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m07:50:07.794157 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:50:07.799024 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.800029 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:50:07.801374 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.803057 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.804065 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m07:50:07.804065 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:07.804570 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.804570 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.804570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m07:50:07.847825 [debug] [Thread-1 (]: SQL status: OK in 0.043 seconds
[0m07:50:07.848992 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.848992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_indexador'
  
[0m07:50:07.850154 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.851185 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.851185 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_indexador'
  
[0m07:50:07.851185 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.855480 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.855859 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador" rename to "fato_carteira_credito_indexador__dbt_backup"
[0m07:50:07.855859 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.858377 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.858377 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m07:50:07.859382 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.860391 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m07:50:07.860391 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.860391 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m07:50:07.880837 [debug] [Thread-1 (]: SQL status: OK in 0.020 seconds
[0m07:50:07.883365 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m07:50:07.883365 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m07:50:07.884364 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:07.885980 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m07:50:07.885980 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB692DEA20>]}
[0m07:50:07.887503 [info ] [Thread-1 (]: 16 of 87 OK created sql table model main.fato_carteira_credito_indexador ....... [[32mOK[0m in 0.09s]
[0m07:50:07.887503 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m07:50:07.888518 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:50:07.888518 [info ] [Thread-1 (]: 17 of 87 START sql table model main.fato_carteira_credito_totais ............... [RUN]
[0m07:50:07.889515 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m07:50:07.889515 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:50:07.893166 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.894166 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:50:07.897687 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.898693 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.899199 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m07:50:07.899199 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:07.899199 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.900205 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.900205 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m07:50:07.954732 [debug] [Thread-1 (]: SQL status: OK in 0.054 seconds
[0m07:50:07.955921 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.955921 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_totais'
  
[0m07:50:07.957184 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.958376 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.958682 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_totais'
  
[0m07:50:07.958682 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.962010 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.962526 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais" rename to "fato_carteira_credito_totais__dbt_backup"
[0m07:50:07.963534 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.966230 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.966784 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m07:50:07.967790 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:07.968790 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m07:50:07.968790 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:07.968790 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m07:50:08.052889 [debug] [Thread-1 (]: SQL status: OK in 0.083 seconds
[0m07:50:08.057915 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m07:50:08.058448 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m07:50:08.060128 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:08.061136 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m07:50:08.063663 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB477CA5A0>]}
[0m07:50:08.065148 [info ] [Thread-1 (]: 17 of 87 OK created sql table model main.fato_carteira_credito_totais .......... [[32mOK[0m in 0.17s]
[0m07:50:08.066460 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m07:50:08.067104 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:50:08.067104 [info ] [Thread-1 (]: 18 of 87 START sql table model main.fato_demonstracao_resultado ................ [RUN]
[0m07:50:08.067104 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m07:50:08.068413 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:50:08.072944 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.074021 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:50:08.076757 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.077765 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.077765 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m07:50:08.077765 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:08.078778 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.078778 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.078778 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m07:50:08.589872 [debug] [Thread-1 (]: SQL status: OK in 0.510 seconds
[0m07:50:08.589872 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.589872 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_demonstracao_resultado'
  
[0m07:50:08.592128 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.593139 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.593139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_demonstracao_resultado'
  
[0m07:50:08.594132 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.596221 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.596221 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado" rename to "fato_demonstracao_resultado__dbt_backup"
[0m07:50:08.596221 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.599283 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.599808 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m07:50:08.599808 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.601089 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:50:08.601721 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.601721 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:50:08.736415 [debug] [Thread-1 (]: SQL status: OK in 0.135 seconds
[0m07:50:08.740153 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:50:08.740153 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m07:50:08.742675 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:08.744217 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m07:50:08.744217 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB692B35F0>]}
[0m07:50:08.744217 [info ] [Thread-1 (]: 18 of 87 OK created sql table model main.fato_demonstracao_resultado ........... [[32mOK[0m in 0.68s]
[0m07:50:08.745877 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:50:08.745877 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:50:08.747407 [info ] [Thread-1 (]: 19 of 87 START sql table model main.fato_movimentacao_cambio ................... [RUN]
[0m07:50:08.747407 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m07:50:08.748442 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:50:08.752607 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.753169 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:50:08.757490 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.759189 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.759189 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m07:50:08.759189 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:08.760286 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:08.761303 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.761303 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m07:50:08.765996 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:50:08.767026 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.767026 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_movimentacao_cambio'
  
[0m07:50:08.768125 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.769130 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.769130 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_movimentacao_cambio'
  
[0m07:50:08.769130 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.772326 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.772326 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio" rename to "fato_movimentacao_cambio__dbt_backup"
[0m07:50:08.773975 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.776167 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.776674 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m07:50:08.777214 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.778240 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m07:50:08.778240 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.778240 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m07:50:08.782845 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:50:08.784862 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m07:50:08.784862 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m07:50:08.786493 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:08.787523 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m07:50:08.788059 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB477134A0>]}
[0m07:50:08.788059 [info ] [Thread-1 (]: 19 of 87 OK created sql table model main.fato_movimentacao_cambio .............. [[32mOK[0m in 0.04s]
[0m07:50:08.788059 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m07:50:08.788059 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:50:08.789564 [info ] [Thread-1 (]: 20 of 87 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m07:50:08.789564 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m07:50:08.790570 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:50:08.793081 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.794083 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:50:08.796602 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.797602 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.797602 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m07:50:08.798108 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:08.798612 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.798612 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.798612 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m07:50:08.827120 [debug] [Thread-1 (]: SQL status: OK in 0.028 seconds
[0m07:50:08.827120 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.828537 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_operacoes_clientes'
  
[0m07:50:08.828537 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.830190 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.830190 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_operacoes_clientes'
  
[0m07:50:08.830190 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.832705 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.833722 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes" rename to "fato_operacoes_clientes__dbt_backup"
[0m07:50:08.833722 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.835739 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.835739 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m07:50:08.837273 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.837983 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m07:50:08.837983 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.837983 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m07:50:08.844448 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:50:08.848513 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m07:50:08.848513 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m07:50:08.850124 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:08.850845 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m07:50:08.850845 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B7C40E0>]}
[0m07:50:08.851874 [info ] [Thread-1 (]: 20 of 87 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.06s]
[0m07:50:08.851874 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m07:50:08.852858 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:50:08.853362 [info ] [Thread-1 (]: 21 of 87 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m07:50:08.853362 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m07:50:08.854393 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:50:08.857210 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:08.858323 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:50:08.860548 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:08.861560 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:08.861560 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m07:50:08.861560 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:08.862561 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:08.862561 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:08.862561 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    md5(cast(cast(d.codigo as bigint) as varchar))
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m07:50:09.105796 [debug] [Thread-1 (]: SQL status: OK in 0.243 seconds
[0m07:50:09.106926 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:09.106926 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m07:50:09.107673 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.108833 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:09.108833 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m07:50:09.109684 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.111206 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:09.111206 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m07:50:09.112711 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.114792 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:09.114792 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m07:50:09.115334 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.116363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m07:50:09.116363 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:09.116363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m07:50:09.274116 [debug] [Thread-1 (]: SQL status: OK in 0.157 seconds
[0m07:50:09.275782 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m07:50:09.275782 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m07:50:09.278292 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:09.278292 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m07:50:09.278292 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB477A6600>]}
[0m07:50:09.279795 [info ] [Thread-1 (]: 21 of 87 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.42s]
[0m07:50:09.280453 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m07:50:09.280453 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:50:09.280453 [info ] [Thread-1 (]: 22 of 87 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m07:50:09.280453 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m07:50:09.281986 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:50:09.287672 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:50:09.287672 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:50:09.299921 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:50:09.301522 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:50:09.302527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m07:50:09.303029 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:09.304536 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:09.304536 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:50:09.304536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m07:50:09.305540 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.309858 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m07:50:09.312367 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m07:50:09.312890 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m07:50:09.313423 [info ] [Thread-1 (]: 22 of 87 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.03s]
[0m07:50:09.314020 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:50:09.314020 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:50:09.315025 [info ] [Thread-1 (]: 23 of 87 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m07:50:09.316040 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m07:50:09.316040 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:50:09.322339 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:50:09.323387 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:50:09.325505 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:50:09.326038 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:50:09.326038 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m07:50:09.326038 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:09.327063 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.327063 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:50:09.327063 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:50:09.329598 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:09.330836 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m07:50:09.330836 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m07:50:09.332373 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m07:50:09.332373 [info ] [Thread-1 (]: 23 of 87 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m07:50:09.334399 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:50:09.334399 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:50:09.334399 [info ] [Thread-1 (]: 24 of 87 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m07:50:09.335386 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m07:50:09.335386 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:50:09.337946 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:50:09.339742 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:50:09.341757 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:50:09.342261 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:50:09.343267 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m07:50:09.343267 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:09.344782 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:09.344782 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:50:09.345614 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m07:50:09.346135 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.346135 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m07:50:09.347682 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m07:50:09.347682 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m07:50:09.348694 [info ] [Thread-1 (]: 24 of 87 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m07:50:09.348694 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:50:09.348694 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:50:09.348694 [info ] [Thread-1 (]: 25 of 87 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m07:50:09.350657 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m07:50:09.350657 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:50:09.352836 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:50:09.352836 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:50:09.356081 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:50:09.356594 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:50:09.356594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m07:50:09.357600 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:09.358105 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.358105 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:50:09.358628 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:50:09.359632 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:09.360218 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m07:50:09.361859 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m07:50:09.361859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m07:50:09.362370 [info ] [Thread-1 (]: 25 of 87 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m07:50:09.362922 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:50:09.363529 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:50:09.363529 [info ] [Thread-1 (]: 26 of 87 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m07:50:09.364090 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m07:50:09.364627 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:50:09.367778 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:50:09.367778 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:50:09.370274 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:50:09.370274 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:50:09.371279 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m07:50:09.371279 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:09.371279 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.372302 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:50:09.372302 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m07:50:09.372302 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.373861 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m07:50:09.374383 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m07:50:09.374383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m07:50:09.375413 [info ] [Thread-1 (]: 26 of 87 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m07:50:09.375413 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:50:09.375413 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:50:09.376953 [info ] [Thread-1 (]: 27 of 87 START test unique_dim_controle_id_controle ............................ [RUN]
[0m07:50:09.377693 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m07:50:09.377693 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:50:09.381207 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:50:09.381207 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:50:09.383512 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:50:09.384490 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:50:09.384490 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m07:50:09.385492 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:09.385492 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.385492 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:50:09.386491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:50:09.387491 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:09.389527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m07:50:09.390568 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m07:50:09.390568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m07:50:09.391567 [info ] [Thread-1 (]: 27 of 87 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m07:50:09.392107 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:50:09.392107 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:50:09.392785 [info ] [Thread-1 (]: 28 of 87 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m07:50:09.392785 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m07:50:09.392785 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:50:09.396362 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:09.397346 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:50:09.400476 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:09.401157 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:09.401157 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m07:50:09.401157 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:09.401157 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:09.401157 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:09.402885 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:50:16.555658 [debug] [Thread-1 (]: SQL status: OK in 7.153 seconds
[0m07:50:16.557645 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:16.557645 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_atividade'
  
[0m07:50:16.558329 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.559841 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:16.559841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_atividade'
  
[0m07:50:16.560849 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.563713 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:16.564717 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade" rename to "fato_carteira_credito_atividade__dbt_backup"
[0m07:50:16.565221 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.568559 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:16.569560 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m07:50:16.569560 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.571663 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m07:50:16.572196 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:16.572707 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m07:50:16.704357 [debug] [Thread-1 (]: SQL status: OK in 0.132 seconds
[0m07:50:16.706421 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m07:50:16.706421 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m07:50:16.708600 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:16.710113 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m07:50:16.711118 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB46C7CCB0>]}
[0m07:50:16.711118 [info ] [Thread-1 (]: 28 of 87 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 7.32s]
[0m07:50:16.712623 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m07:50:16.712623 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:50:16.713208 [info ] [Thread-1 (]: 29 of 87 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m07:50:16.713813 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m07:50:16.713813 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:50:16.717004 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:50:16.717004 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:50:16.719562 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:50:16.720540 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:50:16.720540 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m07:50:16.721045 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.721564 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.721564 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:50:16.721564 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:16.722212 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.723908 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m07:50:16.724482 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m07:50:16.724482 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m07:50:16.725005 [info ] [Thread-1 (]: 29 of 87 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.01s]
[0m07:50:16.725514 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:50:16.725514 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:50:16.725514 [info ] [Thread-1 (]: 30 of 87 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m07:50:16.727043 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m07:50:16.727043 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:50:16.730157 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:50:16.730157 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:50:16.732162 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:50:16.733396 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:50:16.733396 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m07:50:16.734078 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.734078 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.734078 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:50:16.735100 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:50:16.735100 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.737604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m07:50:16.738619 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m07:50:16.738619 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m07:50:16.738619 [info ] [Thread-1 (]: 30 of 87 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m07:50:16.739616 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:50:16.739616 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:50:16.740681 [info ] [Thread-1 (]: 31 of 87 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m07:50:16.740681 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m07:50:16.740681 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:50:16.745247 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:50:16.745247 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:50:16.747754 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:50:16.747754 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:50:16.748759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m07:50:16.749265 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.749265 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.749265 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:50:16.750288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:16.750813 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:16.752497 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m07:50:16.753036 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m07:50:16.753036 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m07:50:16.753036 [info ] [Thread-1 (]: 31 of 87 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.01s]
[0m07:50:16.753036 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:50:16.754804 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:50:16.754804 [info ] [Thread-1 (]: 32 of 87 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m07:50:16.755422 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m07:50:16.755422 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:50:16.759693 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:50:16.760380 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:50:16.762402 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:50:16.763165 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:50:16.763165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m07:50:16.763165 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.764191 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.764700 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:50:16.764700 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:16.766760 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:16.768763 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m07:50:16.768763 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m07:50:16.770284 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m07:50:16.770284 [info ] [Thread-1 (]: 32 of 87 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m07:50:16.771644 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:50:16.772438 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:50:16.772438 [info ] [Thread-1 (]: 33 of 87 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m07:50:16.772438 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m07:50:16.773484 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:50:16.777326 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:50:16.778333 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:50:16.781029 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:50:16.782042 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:50:16.783098 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m07:50:16.783098 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.784096 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:16.785096 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:50:16.785096 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:16.787602 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:16.788631 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m07:50:16.789741 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m07:50:16.789741 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m07:50:16.789741 [info ] [Thread-1 (]: 33 of 87 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m07:50:16.800880 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:50:16.801883 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:50:16.804551 [info ] [Thread-1 (]: 34 of 87 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m07:50:16.807336 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m07:50:16.808337 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:50:16.817373 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:50:16.822372 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:50:16.826896 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:50:16.828891 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:50:16.829894 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m07:50:16.830890 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.831890 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:16.832890 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:50:16.833891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:50:16.839423 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:50:16.842285 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m07:50:16.844187 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m07:50:16.845197 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m07:50:16.846209 [info ] [Thread-1 (]: 34 of 87 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.04s]
[0m07:50:16.847699 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:50:16.849214 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:50:16.849214 [info ] [Thread-1 (]: 35 of 87 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m07:50:16.852109 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m07:50:16.853118 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:50:16.862850 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:50:16.865857 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:50:16.873330 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:50:16.876856 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:50:16.876856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m07:50:16.877775 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.878785 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:16.880292 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:50:16.881302 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:50:16.882818 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:16.885815 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m07:50:16.887826 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m07:50:16.887826 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m07:50:16.888839 [info ] [Thread-1 (]: 35 of 87 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.04s]
[0m07:50:16.890551 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:50:16.890551 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:50:16.891559 [info ] [Thread-1 (]: 36 of 87 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m07:50:16.893415 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m07:50:16.894421 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:50:16.901133 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:50:16.902697 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:50:16.905869 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:50:16.906942 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:50:16.907455 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m07:50:16.907455 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.907993 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.907993 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:50:16.908645 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:16.910155 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:16.911159 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m07:50:16.912668 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m07:50:16.913247 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m07:50:16.913799 [info ] [Thread-1 (]: 36 of 87 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m07:50:16.914809 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:50:16.914809 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:50:16.916382 [info ] [Thread-1 (]: 37 of 87 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m07:50:16.917090 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m07:50:16.918098 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:50:16.923933 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:50:16.925447 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:50:16.929473 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:50:16.930140 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:50:16.931155 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m07:50:16.931155 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.931155 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:16.932155 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:50:16.932668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:50:16.935322 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:16.936334 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m07:50:16.937832 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m07:50:16.937832 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m07:50:16.937832 [info ] [Thread-1 (]: 37 of 87 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m07:50:16.939383 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:50:16.939383 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:50:16.940390 [info ] [Thread-1 (]: 38 of 87 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m07:50:16.941392 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m07:50:16.941989 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:50:16.944549 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:16.944549 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:50:16.947560 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:16.947560 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:16.948950 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m07:50:16.948950 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:16.948950 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:16.949954 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:16.949954 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:50:17.108997 [debug] [Thread-1 (]: SQL status: OK in 0.159 seconds
[0m07:50:17.110100 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:17.110100 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_porte'
  
[0m07:50:17.111124 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:17.111124 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:17.112662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_porte'
  
[0m07:50:17.112662 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:17.115452 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:17.115992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte" rename to "fato_carteira_credito_porte__dbt_backup"
[0m07:50:17.116506 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:17.119233 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:17.119767 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m07:50:17.120273 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:17.121302 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m07:50:17.121894 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:17.122404 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m07:50:17.128923 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:50:17.132158 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m07:50:17.132741 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m07:50:17.133815 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:17.134887 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m07:50:17.135408 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B762480>]}
[0m07:50:18.152505 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m07:50:18.155700 [info ] [Thread-1 (]: 38 of 87 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.19s]
[0m07:50:18.157246 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m07:50:18.157876 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:50:18.158492 [info ] [Thread-1 (]: 39 of 87 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m07:50:18.160011 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m07:50:18.161047 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:50:18.168996 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:18.170005 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:50:18.174131 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:18.175416 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:18.175416 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m07:50:18.175416 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:18.176992 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:18.176992 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:18.178000 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m07:50:28.872461 [debug] [Thread-1 (]: SQL status: OK in 10.694 seconds
[0m07:50:28.874258 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:28.874258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_produto'
  
[0m07:50:28.875060 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:28.876067 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:28.876067 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_carteira_credito_produto'
  
[0m07:50:28.877065 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:28.878577 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:28.879575 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto" rename to "fato_carteira_credito_produto__dbt_backup"
[0m07:50:28.880080 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:28.882190 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:28.882513 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m07:50:28.882513 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:28.883418 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m07:50:28.883418 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:28.884472 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m07:50:28.918148 [debug] [Thread-1 (]: SQL status: OK in 0.033 seconds
[0m07:50:28.919163 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m07:50:28.919163 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m07:50:28.921286 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:28.922797 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m07:50:28.922797 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4B762030>]}
[0m07:50:28.923803 [info ] [Thread-1 (]: 39 of 87 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 10.76s]
[0m07:50:28.924425 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m07:50:28.924425 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:50:28.925430 [info ] [Thread-1 (]: 40 of 87 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m07:50:28.925430 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m07:50:28.925430 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:50:28.928824 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:28.929827 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:50:28.931836 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:28.932842 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:28.932842 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m07:50:28.932842 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:28.933841 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:28.933841 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:28.933841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:50:29.140560 [debug] [Thread-1 (]: SQL status: OK in 0.206 seconds
[0m07:50:29.141560 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:29.141560 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_regiao_credito'
  
[0m07:50:29.142169 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.143762 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:29.143762 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_regiao_credito'
  
[0m07:50:29.144319 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.147659 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:29.148689 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito" rename to "fato_regiao_credito__dbt_backup"
[0m07:50:29.148689 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.151386 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:29.151386 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m07:50:29.151967 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.152997 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m07:50:29.152997 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:29.152997 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m07:50:29.162824 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m07:50:29.165143 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m07:50:29.165143 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m07:50:29.166294 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.166909 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m07:50:29.166909 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB477D5EE0>]}
[0m07:50:29.167937 [info ] [Thread-1 (]: 40 of 87 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.24s]
[0m07:50:29.168440 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m07:50:29.168440 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:50:29.169451 [info ] [Thread-1 (]: 41 of 87 START sql table model main.fato_risco_credito ......................... [RUN]
[0m07:50:29.170452 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m07:50:29.170452 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:50:29.173652 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.174650 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:50:29.179750 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.180448 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.180448 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m07:50:29.182123 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.182123 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.182123 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.183154 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m07:50:29.470711 [debug] [Thread-1 (]: SQL status: OK in 0.287 seconds
[0m07:50:29.471229 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.471917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_risco_credito'
  
[0m07:50:29.471917 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.473501 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.473501 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_risco_credito'
  
[0m07:50:29.474175 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.475924 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.476928 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito" rename to "fato_risco_credito__dbt_backup"
[0m07:50:29.476928 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.478102 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.478102 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m07:50:29.479607 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.480260 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m07:50:29.480260 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.481291 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m07:50:29.537721 [debug] [Thread-1 (]: SQL status: OK in 0.056 seconds
[0m07:50:29.539316 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m07:50:29.539975 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m07:50:29.541614 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.542159 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m07:50:29.543167 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '93b360bb-0012-4023-998b-dd56c4dea85b', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4773B1A0>]}
[0m07:50:29.543167 [info ] [Thread-1 (]: 41 of 87 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.37s]
[0m07:50:29.544164 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m07:50:29.544164 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:50:29.544164 [info ] [Thread-1 (]: 42 of 87 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m07:50:29.545336 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m07:50:29.545336 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:50:29.548398 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:50:29.548398 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:50:29.551397 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:50:29.552914 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:50:29.552914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m07:50:29.553485 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.553485 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.553485 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:50:29.554489 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.555030 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.556538 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m07:50:29.556538 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m07:50:29.557622 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m07:50:29.558125 [info ] [Thread-1 (]: 42 of 87 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m07:50:29.558691 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:50:29.558691 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:50:29.559245 [info ] [Thread-1 (]: 43 of 87 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m07:50:29.559245 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m07:50:29.560250 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:50:29.565018 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:50:29.565524 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:50:29.567609 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:50:29.568797 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:50:29.569320 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m07:50:29.569320 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.570492 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.570492 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:50:29.570492 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.572003 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.573544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m07:50:29.574553 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m07:50:29.575559 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m07:50:29.575559 [info ] [Thread-1 (]: 43 of 87 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m07:50:29.575559 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:50:29.577267 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:50:29.577267 [info ] [Thread-1 (]: 44 of 87 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m07:50:29.578273 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m07:50:29.578273 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:50:29.580400 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:50:29.581933 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:50:29.584678 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:50:29.585673 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:50:29.585673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m07:50:29.585673 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.587186 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.587186 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:50:29.587186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:50:29.587777 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.590457 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m07:50:29.591961 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m07:50:29.591961 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m07:50:29.591961 [info ] [Thread-1 (]: 44 of 87 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m07:50:29.592968 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:50:29.593966 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:50:29.593966 [info ] [Thread-1 (]: 45 of 87 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m07:50:29.593966 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m07:50:29.593966 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:50:29.597648 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:50:29.598678 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:50:29.600701 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:50:29.601204 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:50:29.601204 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m07:50:29.602786 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.603323 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.603323 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:50:29.603323 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.604327 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.605379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m07:50:29.605379 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m07:50:29.605379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m07:50:29.605379 [info ] [Thread-1 (]: 45 of 87 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m07:50:29.607687 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:50:29.608225 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:50:29.608225 [info ] [Thread-1 (]: 46 of 87 START test unique_dim_tempo_id_data ................................... [RUN]
[0m07:50:29.608225 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m07:50:29.609229 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:50:29.612304 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:50:29.613001 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:50:29.615355 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:50:29.617354 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:50:29.617876 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m07:50:29.617876 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.617876 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.618875 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:50:29.618875 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:50:29.621424 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:29.622936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m07:50:29.624341 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m07:50:29.624341 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m07:50:29.624341 [info ] [Thread-1 (]: 46 of 87 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m07:50:29.625348 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:50:29.625348 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:50:29.625348 [info ] [Thread-1 (]: 47 of 87 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m07:50:29.626978 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m07:50:29.626978 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:50:29.629985 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:50:29.630490 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:50:29.634007 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:50:29.635009 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:50:29.636008 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m07:50:29.636008 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.636008 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.636008 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:50:29.637514 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.638519 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.639520 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m07:50:29.640026 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m07:50:29.640026 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m07:50:29.640026 [info ] [Thread-1 (]: 47 of 87 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.01s]
[0m07:50:29.641531 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:50:29.642103 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:50:29.642103 [info ] [Thread-1 (]: 48 of 87 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m07:50:29.643110 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m07:50:29.643110 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:50:29.646816 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:50:29.647817 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:50:29.649264 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:50:29.650269 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:50:29.651300 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m07:50:29.651300 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.651300 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.651300 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:50:29.652905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.652905 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.654515 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m07:50:29.655531 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m07:50:29.655531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m07:50:29.656036 [info ] [Thread-1 (]: 48 of 87 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m07:50:29.656540 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:50:29.656540 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:50:29.657545 [info ] [Thread-1 (]: 49 of 87 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:50:29.658049 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m07:50:29.658049 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:50:29.662269 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:50:29.662873 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:50:29.665054 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:50:29.665054 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:50:29.666212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m07:50:29.666212 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.666212 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.667228 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:50:29.667228 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.670260 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:50:29.671772 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m07:50:29.672393 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m07:50:29.672393 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m07:50:29.673399 [info ] [Thread-1 (]: 49 of 87 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:50:29.673399 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:50:29.673399 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:50:29.673399 [info ] [Thread-1 (]: 50 of 87 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:50:29.674789 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m07:50:29.674789 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:50:29.680433 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:50:29.682012 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:50:29.683019 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:50:29.684019 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:50:29.685019 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m07:50:29.685019 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.685019 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.686019 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:50:29.686019 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.690032 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:50:29.691536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m07:50:29.692748 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m07:50:29.693266 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m07:50:29.693266 [info ] [Thread-1 (]: 50 of 87 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:50:29.694269 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:50:29.694269 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:50:29.694269 [info ] [Thread-1 (]: 51 of 87 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m07:50:29.695453 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m07:50:29.695453 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:50:29.697457 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:50:29.698703 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:50:29.701020 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:50:29.701020 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:50:29.701020 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m07:50:29.702611 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.703210 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.703210 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m07:50:29.703210 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.704221 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.705402 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m07:50:29.705402 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m07:50:29.706406 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m07:50:29.706406 [info ] [Thread-1 (]: 51 of 87 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.01s]
[0m07:50:29.707525 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m07:50:29.708032 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:50:29.708032 [info ] [Thread-1 (]: 52 of 87 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m07:50:29.708546 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m07:50:29.709165 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:50:29.713597 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:50:29.713597 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:50:29.716705 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:50:29.717712 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:50:29.717712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m07:50:29.717712 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.718737 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.718737 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m07:50:29.718737 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.720246 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.721276 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m07:50:29.721939 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m07:50:29.721939 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m07:50:29.722947 [info ] [Thread-1 (]: 52 of 87 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m07:50:29.722947 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m07:50:29.723840 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:50:29.723840 [info ] [Thread-1 (]: 53 of 87 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:50:29.724432 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m07:50:29.724432 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:50:29.728216 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:50:29.728216 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:50:29.731940 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:50:29.732943 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:50:29.732943 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m07:50:29.732943 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.733946 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.733946 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:50:29.733946 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.735944 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:29.738071 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m07:50:29.738071 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m07:50:29.738071 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m07:50:29.740026 [info ] [Thread-1 (]: 53 of 87 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:50:29.740695 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:50:29.740695 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:50:29.741716 [info ] [Thread-1 (]: 54 of 87 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:50:29.741716 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m07:50:29.743170 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:50:29.747853 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:50:29.748478 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:50:29.750166 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:50:29.751217 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:50:29.751217 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m07:50:29.751217 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.751217 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.752996 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:50:29.752996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.758091 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:50:29.759254 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m07:50:29.760762 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m07:50:29.760762 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m07:50:29.760762 [info ] [Thread-1 (]: 54 of 87 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:50:29.761769 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:50:29.762769 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:50:29.763273 [info ] [Thread-1 (]: 55 of 87 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m07:50:29.763847 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m07:50:29.763847 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:50:29.766486 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:50:29.767120 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:50:29.769139 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:50:29.772104 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:50:29.772104 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m07:50:29.773786 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.773786 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.773786 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m07:50:29.774890 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.775590 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.777107 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m07:50:29.777107 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m07:50:29.778130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m07:50:29.778130 [info ] [Thread-1 (]: 55 of 87 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m07:50:29.778130 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m07:50:29.778130 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:50:29.779637 [info ] [Thread-1 (]: 56 of 87 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m07:50:29.780228 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m07:50:29.780228 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:50:29.785302 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:50:29.787309 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:50:29.793000 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:50:29.794019 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:50:29.794019 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m07:50:29.794019 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.795622 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.795622 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m07:50:29.795622 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.797134 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.797650 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m07:50:29.799163 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m07:50:29.799163 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m07:50:29.799163 [info ] [Thread-1 (]: 56 of 87 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m07:50:29.800169 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m07:50:29.800804 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:50:29.800804 [info ] [Thread-1 (]: 57 of 87 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:50:29.800804 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m07:50:29.800804 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:50:29.807805 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:50:29.808332 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:50:29.810379 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:50:29.811524 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:50:29.811524 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m07:50:29.811524 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.812541 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.812541 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:50:29.812541 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.814918 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:29.814918 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m07:50:29.816510 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m07:50:29.817062 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m07:50:29.817062 [info ] [Thread-1 (]: 57 of 87 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:50:29.818075 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:50:29.818075 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:50:29.819076 [info ] [Thread-1 (]: 58 of 87 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:50:29.819076 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m07:50:29.819076 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:50:29.823509 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:50:29.823509 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:50:29.827073 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:50:29.827073 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:50:29.827073 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m07:50:29.828597 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.828597 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.828597 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:50:29.828597 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.832241 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:50:29.834039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m07:50:29.834039 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m07:50:29.835043 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m07:50:29.835043 [info ] [Thread-1 (]: 58 of 87 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:50:29.836045 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:50:29.836045 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:50:29.837550 [info ] [Thread-1 (]: 59 of 87 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m07:50:29.837550 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m07:50:29.838556 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:50:29.840749 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:50:29.841746 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:50:29.843832 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:50:29.844335 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:50:29.844335 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m07:50:29.845339 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.845339 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.845339 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m07:50:29.845339 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.846788 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.847768 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m07:50:29.847768 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m07:50:29.849032 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m07:50:29.849032 [info ] [Thread-1 (]: 59 of 87 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m07:50:29.849032 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m07:50:29.851267 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:50:29.851267 [info ] [Thread-1 (]: 60 of 87 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m07:50:29.852894 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m07:50:29.852894 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:50:29.856763 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:50:29.858008 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:50:29.860224 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:50:29.861229 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:50:29.861229 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m07:50:29.862229 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.862850 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.863899 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m07:50:29.863899 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.863899 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.866431 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m07:50:29.866990 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m07:50:29.868004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m07:50:29.868004 [info ] [Thread-1 (]: 60 of 87 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.02s]
[0m07:50:29.869003 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m07:50:29.869003 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:50:29.870842 [info ] [Thread-1 (]: 61 of 87 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:50:29.871348 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m07:50:29.871348 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:50:29.878911 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:50:29.880420 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:50:29.882952 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:50:29.882952 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:50:29.883944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m07:50:29.883944 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.883944 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.884929 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:50:29.884929 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.885930 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:29.888016 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m07:50:29.888016 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m07:50:29.888016 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m07:50:29.889565 [info ] [Thread-1 (]: 61 of 87 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:50:29.889565 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:50:29.889565 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:50:29.891099 [info ] [Thread-1 (]: 62 of 87 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:50:29.891612 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m07:50:29.892150 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:50:29.895901 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:50:29.895901 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:50:29.898579 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:50:29.898579 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:50:29.898579 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m07:50:29.900558 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.900558 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.901209 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:50:29.901209 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.904714 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:50:29.905843 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m07:50:29.906389 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m07:50:29.906389 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m07:50:29.907401 [info ] [Thread-1 (]: 62 of 87 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:50:29.907958 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:50:29.908489 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:50:29.908489 [info ] [Thread-1 (]: 63 of 87 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m07:50:29.909582 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m07:50:29.909582 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:50:29.912770 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:50:29.914282 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:50:29.916296 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:50:29.916809 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:50:29.916809 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m07:50:29.916809 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.917816 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.917816 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:50:29.918816 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.918816 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.920324 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m07:50:29.921373 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m07:50:29.921373 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m07:50:29.921373 [info ] [Thread-1 (]: 63 of 87 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m07:50:29.922450 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:50:29.922450 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:50:29.923496 [info ] [Thread-1 (]: 64 of 87 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m07:50:29.923496 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m07:50:29.923496 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:50:29.927367 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:50:29.928379 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:50:29.935362 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:50:29.937877 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:50:29.939598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m07:50:29.939598 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.941610 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.942427 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:50:29.943130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.944639 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:29.949191 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m07:50:29.951217 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m07:50:29.951217 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m07:50:29.952990 [info ] [Thread-1 (]: 64 of 87 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.03s]
[0m07:50:29.954574 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:50:29.954574 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:50:29.954574 [info ] [Thread-1 (]: 65 of 87 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:50:29.955581 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m07:50:29.955581 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:50:29.960682 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:50:29.960682 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:50:29.963969 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:50:29.964976 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:50:29.965482 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m07:50:29.965987 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.965987 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.965987 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:50:29.966995 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.969507 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:29.970508 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m07:50:29.971080 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m07:50:29.971684 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m07:50:29.972218 [info ] [Thread-1 (]: 65 of 87 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:50:29.972218 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:50:29.972218 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:50:29.973358 [info ] [Thread-1 (]: 66 of 87 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:50:29.973934 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m07:50:29.973934 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:50:29.978061 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:50:29.980211 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:50:29.981760 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:50:29.982352 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:50:29.982352 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m07:50:29.983358 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:29.983358 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:29.983358 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:50:29.984381 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:29.988082 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:50:29.989826 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m07:50:29.990856 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m07:50:29.990856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m07:50:29.990856 [info ] [Thread-1 (]: 66 of 87 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:50:29.992155 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:50:29.992155 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:50:29.992155 [info ] [Thread-1 (]: 67 of 87 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m07:50:29.993030 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m07:50:29.993030 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:50:29.995563 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:50:29.996674 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:50:29.998692 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:50:29.998692 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:50:29.998692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m07:50:30.000216 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.000216 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.000216 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m07:50:30.001240 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.001240 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.002815 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m07:50:30.003456 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m07:50:30.003456 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m07:50:30.004044 [info ] [Thread-1 (]: 67 of 87 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m07:50:30.004569 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m07:50:30.004569 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:50:30.005576 [info ] [Thread-1 (]: 68 of 87 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m07:50:30.005576 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m07:50:30.005576 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:50:30.009314 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:50:30.010352 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:50:30.011365 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:50:30.013160 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:50:30.013765 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m07:50:30.013765 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.014775 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:30.015280 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m07:50:30.015280 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.016285 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.016892 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m07:50:30.017897 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m07:50:30.017897 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m07:50:30.018898 [info ] [Thread-1 (]: 68 of 87 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m07:50:30.018898 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m07:50:30.018898 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:50:30.020402 [info ] [Thread-1 (]: 69 of 87 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:50:30.020402 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m07:50:30.020402 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:50:30.024314 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:50:30.025833 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:50:30.027337 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:50:30.028342 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:50:30.028342 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m07:50:30.028342 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.028342 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.029844 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:50:30.029844 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.030848 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:30.031926 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m07:50:30.032930 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m07:50:30.032930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m07:50:30.033950 [info ] [Thread-1 (]: 69 of 87 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m07:50:30.033950 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:50:30.034930 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:50:30.034930 [info ] [Thread-1 (]: 70 of 87 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:50:30.034930 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m07:50:30.034930 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:50:30.040723 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:50:30.041721 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:50:30.044736 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:50:30.045241 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:50:30.046247 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m07:50:30.046247 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.046247 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:30.046247 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:50:30.047752 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.049804 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:30.050929 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m07:50:30.050929 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m07:50:30.050929 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m07:50:30.052462 [info ] [Thread-1 (]: 70 of 87 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:50:30.053110 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:50:30.053110 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:50:30.053110 [info ] [Thread-1 (]: 71 of 87 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m07:50:30.054117 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m07:50:30.054622 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:50:30.057727 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:50:30.058324 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:50:30.060336 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:50:30.061342 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:50:30.061342 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m07:50:30.061342 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.062343 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.062343 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m07:50:30.063041 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.063041 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.063754 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m07:50:30.065289 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m07:50:30.065289 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m07:50:30.065289 [info ] [Thread-1 (]: 71 of 87 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m07:50:30.066826 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m07:50:30.066826 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:50:30.066826 [info ] [Thread-1 (]: 72 of 87 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m07:50:30.067833 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m07:50:30.067833 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:50:30.071856 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:50:30.073369 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:50:30.076833 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:50:30.078123 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:50:30.078123 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m07:50:30.078123 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.079627 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.079627 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m07:50:30.080174 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.080174 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.081199 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m07:50:30.082198 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m07:50:30.082198 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m07:50:30.083298 [info ] [Thread-1 (]: 72 of 87 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m07:50:30.083298 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m07:50:30.084282 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:50:30.084282 [info ] [Thread-1 (]: 73 of 87 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:50:30.085283 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m07:50:30.085283 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:50:30.089452 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:50:30.090477 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:50:30.091961 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:50:30.092970 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:50:30.092970 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m07:50:30.092970 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.093974 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.094540 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:50:30.094540 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.096718 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:30.097706 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m07:50:30.098212 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m07:50:30.098732 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m07:50:30.098732 [info ] [Thread-1 (]: 73 of 87 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m07:50:30.098732 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:50:30.098732 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:50:30.100427 [info ] [Thread-1 (]: 74 of 87 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:50:30.100427 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m07:50:30.100427 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:50:30.105357 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:50:30.105357 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:50:30.108160 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:50:30.109752 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:50:30.110344 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m07:50:30.110344 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.110858 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.110858 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:50:30.110858 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.115119 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:50:30.116125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m07:50:30.117420 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m07:50:30.117420 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m07:50:30.118457 [info ] [Thread-1 (]: 74 of 87 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:50:30.118457 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:50:30.119438 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:50:30.119438 [info ] [Thread-1 (]: 75 of 87 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m07:50:30.120436 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m07:50:30.120939 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:50:30.124861 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:50:30.125397 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:50:30.126921 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:50:30.127933 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:50:30.127933 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m07:50:30.128932 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.128932 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.128932 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m07:50:30.129932 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.129932 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.131222 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m07:50:30.132221 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m07:50:30.132731 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m07:50:30.132731 [info ] [Thread-1 (]: 75 of 87 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m07:50:30.133736 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m07:50:30.133736 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:50:30.133736 [info ] [Thread-1 (]: 76 of 87 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m07:50:30.134739 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m07:50:30.134739 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:50:30.138241 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:50:30.139247 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:50:30.139983 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:50:30.142224 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:50:30.142739 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m07:50:30.142739 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.142739 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.142739 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m07:50:30.142739 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.144253 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.145765 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m07:50:30.146269 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m07:50:30.146888 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m07:50:30.147743 [info ] [Thread-1 (]: 76 of 87 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m07:50:30.147743 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m07:50:30.147743 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:50:30.148747 [info ] [Thread-1 (]: 77 of 87 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:50:30.148747 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m07:50:30.149752 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:50:30.152912 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:50:30.154532 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:50:30.155558 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:50:30.156685 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:50:30.156685 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m07:50:30.157819 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.158353 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:30.158353 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:50:30.158353 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.160979 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:30.162499 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m07:50:30.163512 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m07:50:30.164017 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m07:50:30.164017 [info ] [Thread-1 (]: 77 of 87 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:50:30.165024 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:50:30.165024 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:50:30.165024 [info ] [Thread-1 (]: 78 of 87 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:50:30.166823 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m07:50:30.166823 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:50:30.171341 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:50:30.172434 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:50:30.175586 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:50:30.175586 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:50:30.175586 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m07:50:30.175586 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.177188 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.177188 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:50:30.177188 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.186569 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m07:50:30.188114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m07:50:30.188114 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m07:50:30.188114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m07:50:30.189647 [info ] [Thread-1 (]: 78 of 87 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:50:30.190664 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:50:30.190664 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:50:30.190664 [info ] [Thread-1 (]: 79 of 87 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m07:50:30.191664 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m07:50:30.191664 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:50:30.195777 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:50:30.195777 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:50:30.198919 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:50:30.200166 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:50:30.200669 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m07:50:30.201217 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.201217 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.201217 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m07:50:30.201217 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.202807 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.203370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m07:50:30.204399 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m07:50:30.204399 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m07:50:30.204399 [info ] [Thread-1 (]: 79 of 87 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m07:50:30.205480 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m07:50:30.206486 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:50:30.206486 [info ] [Thread-1 (]: 80 of 87 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m07:50:30.206486 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m07:50:30.206486 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:50:30.209915 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:50:30.210923 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:50:30.213505 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:50:30.214725 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:50:30.214725 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m07:50:30.214725 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.214725 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.216249 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m07:50:30.216249 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.216249 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.217253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m07:50:30.218287 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m07:50:30.218287 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m07:50:30.219272 [info ] [Thread-1 (]: 80 of 87 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m07:50:30.220272 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m07:50:30.220272 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:50:30.220272 [info ] [Thread-1 (]: 81 of 87 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m07:50:30.221684 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m07:50:30.221684 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:50:30.225355 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:50:30.225861 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:50:30.230050 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:50:30.231056 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:50:30.231056 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m07:50:30.231056 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.232085 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.232085 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m07:50:30.232085 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.233136 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:30.234137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m07:50:30.235137 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m07:50:30.236138 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m07:50:30.236138 [info ] [Thread-1 (]: 81 of 87 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.02s]
[0m07:50:30.236138 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m07:50:30.237644 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:50:30.237644 [info ] [Thread-1 (]: 82 of 87 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m07:50:30.237644 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m07:50:30.237644 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:50:30.241513 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:50:30.242804 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:50:30.244365 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:50:30.245406 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:50:30.245406 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m07:50:30.245406 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.246482 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.246482 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m07:50:30.246482 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.247974 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:30.248480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m07:50:30.250076 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m07:50:30.250656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m07:50:30.250656 [info ] [Thread-1 (]: 82 of 87 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.01s]
[0m07:50:30.251217 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m07:50:30.251217 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:50:30.251217 [info ] [Thread-1 (]: 83 of 87 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m07:50:30.252944 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m07:50:30.252944 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:50:30.256613 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:50:30.256613 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:50:30.260974 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:50:30.262479 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:50:30.262479 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m07:50:30.262479 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.263487 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:30.263994 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m07:50:30.263994 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.265003 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.265003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m07:50:30.266702 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m07:50:30.266702 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m07:50:30.267713 [info ] [Thread-1 (]: 83 of 87 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.02s]
[0m07:50:30.267713 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m07:50:30.267713 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:50:30.268715 [info ] [Thread-1 (]: 84 of 87 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m07:50:30.268715 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m07:50:30.268715 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:50:30.272303 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:50:30.272303 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:50:30.278302 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:50:30.279806 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:50:30.279806 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m07:50:30.279806 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.280841 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.280841 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m07:50:30.280841 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.281813 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.282855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m07:50:30.283858 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m07:50:30.283858 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m07:50:30.284857 [info ] [Thread-1 (]: 84 of 87 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m07:50:30.285198 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m07:50:30.285198 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:50:30.286216 [info ] [Thread-1 (]: 85 of 87 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m07:50:30.286216 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m07:50:30.287213 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:50:30.290100 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:50:30.292276 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:50:30.293298 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:50:30.294297 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:50:30.294297 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m07:50:30.294297 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.295625 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:50:30.295625 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m07:50:30.296630 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.299163 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:50:30.300186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m07:50:30.301217 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m07:50:30.301217 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m07:50:30.301217 [info ] [Thread-1 (]: 85 of 87 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m07:50:30.302802 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m07:50:30.302802 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:50:30.302802 [info ] [Thread-1 (]: 86 of 87 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m07:50:30.303573 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m07:50:30.304144 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:50:30.306744 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:50:30.308256 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:50:30.309967 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:50:30.310975 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:50:30.310975 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m07:50:30.310975 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.312513 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.312513 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m07:50:30.312513 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.313550 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.313550 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m07:50:30.315167 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m07:50:30.315167 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m07:50:30.316180 [info ] [Thread-1 (]: 86 of 87 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.01s]
[0m07:50:30.316180 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m07:50:30.317223 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:50:30.317223 [info ] [Thread-1 (]: 87 of 87 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m07:50:30.317223 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m07:50:30.318383 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:50:30.321441 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:50:30.322036 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:50:30.324110 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:50:30.325196 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:50:30.325196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m07:50:30.325196 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:50:30.325196 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.325196 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m07:50:30.326772 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m07:50:30.326772 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:50:30.327804 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m07:50:30.328804 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m07:50:30.328804 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m07:50:30.329802 [info ] [Thread-1 (]: 87 of 87 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m07:50:30.330398 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m07:50:30.330398 [debug] [MainThread]: Using duckdb connection "master"
[0m07:50:30.331932 [debug] [MainThread]: On master: BEGIN
[0m07:50:30.331932 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m07:50:30.331932 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:50:30.332938 [debug] [MainThread]: On master: COMMIT
[0m07:50:30.332938 [debug] [MainThread]: Using duckdb connection "master"
[0m07:50:30.332938 [debug] [MainThread]: On master: COMMIT
[0m07:50:30.332938 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:50:30.333938 [debug] [MainThread]: On master: Close
[0m07:50:30.333938 [debug] [MainThread]: Connection 'master' was properly closed.
[0m07:50:30.333938 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m07:50:30.333938 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m07:50:30.334954 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m07:50:30.334954 [info ] [MainThread]: 
[0m07:50:30.334954 [info ] [MainThread]: Finished running 26 table models, 61 data tests in 0 hours 0 minutes and 24.97 seconds (24.97s).
[0m07:50:30.343150 [debug] [MainThread]: Command end result
[0m07:50:30.374528 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:50:30.377101 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:50:30.385457 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m07:50:30.385457 [info ] [MainThread]: 
[0m07:50:30.386440 [info ] [MainThread]: [32mCompleted successfully[0m
[0m07:50:30.386440 [info ] [MainThread]: 
[0m07:50:30.386440 [info ] [MainThread]: Done. PASS=87 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=87
[0m07:50:30.387441 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 2 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m07:50:30.387943 [debug] [MainThread]: Command `dbt build` succeeded at 07:50:30.387943 after 26.31 seconds
[0m07:50:30.387943 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB44EDB740>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB44EDBE30>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001BB4542FBF0>]}
[0m07:50:30.387943 [debug] [MainThread]: Flushing usage events
[0m07:50:31.002562 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m16:03:33.026708 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF8214D4F0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF825FB620>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF825F89E0>]}


============================== 16:03:33.033082 | 56202cae-31b1-40cf-8aab-82af5a7a993e ==============================
[0m16:03:33.033082 [info ] [MainThread]: Running with dbt=1.11.5
[0m16:03:33.033745 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'use_colors': 'True', 'indirect_selection': 'eager', 'invocation_command': 'dbt build', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m16:03:33.344404 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF8217C710>]}
[0m16:03:33.408658 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF83A78470>]}
[0m16:03:33.448363 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m16:03:33.709848 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m16:03:33.820301 [info ] [MainThread]: Unable to do partial parsing because profile has changed
[0m16:03:33.820810 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF84012E10>]}
[0m16:03:36.147343 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on 'dim_instituicao'
in package 'bacen_ifdata_analytics' (models\gold\schema.yml). Arguments to
generic tests should be nested under the `arguments` property.
[0m16:03:36.147343 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF84093A70>]}
[0m16:03:36.538941 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m16:03:36.551405 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF84272ED0>]}
[0m16:03:36.650698 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m16:03:36.680682 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m16:03:36.779853 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF8428B920>]}
[0m16:03:36.780848 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m16:03:36.787398 [info ] [MainThread]: 
[0m16:03:36.788014 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m16:03:36.789024 [info ] [MainThread]: 
[0m16:03:36.789024 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m16:03:36.796291 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m16:03:42.604289 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m16:03:42.605296 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m16:03:42.605296 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m16:03:43.316340 [debug] [ThreadPool]: SQL status: OK in 0.711 seconds
[0m16:03:43.317552 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m16:03:43.319209 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m16:03:43.319209 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m16:03:43.326984 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m16:03:43.326984 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m16:03:43.326984 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m16:03:43.328015 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m16:03:43.329119 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m16:03:43.330624 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m16:03:43.330624 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m16:03:43.331215 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m16:03:43.331215 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m16:03:43.331215 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m16:03:43.332803 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m16:03:43.332803 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m16:03:43.333839 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m16:03:43.333839 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m16:03:43.333839 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m16:03:43.337970 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m16:03:43.345937 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m16:03:43.346571 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m16:03:43.346571 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m16:03:43.346571 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m16:03:43.346571 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m16:03:43.347599 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m16:03:43.359836 [debug] [ThreadPool]: SQL status: OK in 0.013 seconds
[0m16:03:43.360844 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m16:03:43.363044 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m16:03:43.363646 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m16:03:43.363646 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF84450410>]}
[0m16:03:43.364678 [debug] [MainThread]: Using duckdb connection "master"
[0m16:03:43.365187 [debug] [MainThread]: On master: BEGIN
[0m16:03:43.365187 [debug] [MainThread]: Opening a new connection, currently in state init
[0m16:03:43.365798 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m16:03:43.365798 [debug] [MainThread]: On master: COMMIT
[0m16:03:43.365798 [debug] [MainThread]: Using duckdb connection "master"
[0m16:03:43.366383 [debug] [MainThread]: On master: COMMIT
[0m16:03:43.366383 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m16:03:43.367052 [debug] [MainThread]: On master: Close
[0m16:03:43.371571 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m16:03:43.371571 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m16:03:43.371571 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m16:03:43.373204 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m16:03:43.385421 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m16:03:43.387575 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m16:03:43.418168 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m16:03:43.420305 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m16:03:43.420847 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m16:03:43.420847 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m16:03:43.420847 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:43.421854 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m16:03:43.421854 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    md5(cast(cast(codigo_origem as bigint) as varchar))
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
QUALIFY row_number() OVER (PARTITION BY codigo_origem ORDER BY tipo_instituicao) = 1
    );
  
  
[0m16:03:43.971589 [debug] [Thread-1 (]: SQL status: OK in 0.549 seconds
[0m16:03:43.976981 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m16:03:43.976981 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m16:03:43.977988 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:43.988953 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m16:03:43.988953 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m16:03:43.988953 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m16:03:43.996606 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m16:03:44.002554 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m16:03:44.002554 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m16:03:44.005326 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:44.007309 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m16:03:44.010855 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF8488F6B0>]}
[0m16:03:44.011363 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.64s]
[0m16:03:44.011870 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m16:03:44.012664 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m16:03:44.012664 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m16:03:44.012664 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m16:03:44.013964 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m16:03:44.021572 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m16:03:44.022077 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m16:03:44.026933 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m16:03:44.027939 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m16:03:44.029019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m16:03:44.029019 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:44.032067 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:44.033066 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m16:03:44.033066 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m16:03:44.128243 [debug] [Thread-1 (]: SQL status: OK in 0.093 seconds
[0m16:03:44.132775 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m16:03:44.134297 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m16:03:44.135810 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:44.137320 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m16:03:44.137941 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m16:03:44.137941 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m16:03:44.140973 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:44.144228 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m16:03:44.145446 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m16:03:44.145952 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:44.146686 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m16:03:44.147693 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF8488F6B0>]}
[0m16:03:44.148197 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.14s]
[0m16:03:44.149707 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m16:03:44.149707 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m16:03:44.151224 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m16:03:44.151224 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m16:03:44.152825 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m16:03:44.166476 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m16:03:44.167486 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m16:03:44.173226 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m16:03:44.173226 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m16:03:44.174857 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m16:03:44.174857 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:44.174857 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:44.177619 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m16:03:44.179291 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m16:03:44.258235 [debug] [Thread-1 (]: SQL status: OK in 0.077 seconds
[0m16:03:44.261755 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m16:03:44.262258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m16:03:44.262852 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:44.264023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m16:03:44.264023 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m16:03:44.264662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m16:03:44.266823 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:44.268913 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m16:03:44.268913 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m16:03:44.268913 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:44.271903 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m16:03:44.271903 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF844524B0>]}
[0m16:03:44.273438 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.12s]
[0m16:03:44.275408 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m16:03:44.275408 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m16:03:44.277255 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m16:03:44.277984 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m16:03:44.277984 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m16:03:44.284893 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m16:03:44.285886 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m16:03:44.292341 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m16:03:44.293348 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m16:03:44.294347 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m16:03:44.294347 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:44.294347 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:44.296062 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m16:03:44.296627 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m16:03:45.019195 [debug] [Thread-1 (]: SQL status: OK in 0.723 seconds
[0m16:03:45.021464 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m16:03:45.021464 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m16:03:45.023423 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:45.025115 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m16:03:45.025115 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m16:03:45.026168 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m16:03:45.184755 [debug] [Thread-1 (]: SQL status: OK in 0.158 seconds
[0m16:03:45.187291 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m16:03:45.187813 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m16:03:45.187813 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:45.188843 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m16:03:45.188843 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF83E2DDF0>]}
[0m16:03:45.190348 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.91s]
[0m16:03:45.190856 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m16:03:45.190856 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m16:03:45.190856 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m16:03:45.192056 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m16:03:45.193059 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m16:03:45.196723 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m16:03:45.198881 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m16:03:45.200952 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m16:03:45.200952 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m16:03:45.200952 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m16:03:45.200952 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:45.202706 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:45.202706 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m16:03:45.202706 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m16:03:45.396659 [debug] [Thread-1 (]: SQL status: OK in 0.193 seconds
[0m16:03:45.399910 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m16:03:45.400452 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m16:03:45.401091 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:45.401091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m16:03:45.402758 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m16:03:45.402758 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m16:03:45.411670 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m16:03:45.414377 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m16:03:45.415403 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m16:03:45.415936 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:45.417447 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m16:03:45.417953 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF848C2B70>]}
[0m16:03:45.417953 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.23s]
[0m16:03:45.418992 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m16:03:45.418992 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m16:03:45.420525 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m16:03:45.421532 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m16:03:45.421532 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m16:03:45.424963 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m16:03:45.425471 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m16:03:45.430692 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m16:03:45.431319 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m16:03:45.431319 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m16:03:45.432953 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:45.432953 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:45.434466 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m16:03:45.434466 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m16:03:45.487523 [debug] [Thread-1 (]: SQL status: OK in 0.052 seconds
[0m16:03:45.489137 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m16:03:45.490642 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m16:03:45.492292 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:45.494298 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m16:03:45.494805 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m16:03:45.495955 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m16:03:45.520426 [debug] [Thread-1 (]: SQL status: OK in 0.024 seconds
[0m16:03:45.523058 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m16:03:45.523058 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m16:03:45.524657 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:45.526905 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m16:03:45.527921 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA3366990>]}
[0m16:03:45.527921 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.11s]
[0m16:03:45.528977 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m16:03:45.528977 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m16:03:45.530485 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m16:03:45.531632 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m16:03:45.532432 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m16:03:45.537133 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m16:03:45.539377 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m16:03:45.544428 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m16:03:45.546108 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m16:03:45.546108 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m16:03:45.546108 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:45.546108 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:45.546108 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m16:03:45.546108 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m16:03:45.602986 [debug] [Thread-1 (]: SQL status: OK in 0.055 seconds
[0m16:03:45.607911 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m16:03:45.608469 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m16:03:45.609103 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:45.610626 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m16:03:45.612254 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m16:03:45.612254 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m16:03:45.702837 [debug] [Thread-1 (]: SQL status: OK in 0.091 seconds
[0m16:03:45.705349 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m16:03:45.706349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m16:03:45.706855 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:45.707885 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m16:03:45.708877 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF848C6AB0>]}
[0m16:03:45.708877 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.18s]
[0m16:03:45.708877 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m16:03:45.710383 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m16:03:45.711387 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m16:03:45.712390 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m16:03:45.712894 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m16:03:45.717461 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m16:03:45.718969 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m16:03:45.724701 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m16:03:45.727218 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m16:03:45.727796 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m16:03:45.727796 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:45.728802 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:45.728802 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m16:03:45.728802 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m16:03:46.443376 [debug] [Thread-1 (]: SQL status: OK in 0.713 seconds
[0m16:03:46.447191 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m16:03:46.447695 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m16:03:46.448700 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:46.449729 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m16:03:46.450822 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m16:03:46.451407 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m16:03:46.592967 [debug] [Thread-1 (]: SQL status: OK in 0.142 seconds
[0m16:03:46.596741 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m16:03:46.596741 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m16:03:46.596741 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:46.598295 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m16:03:46.599318 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA33B1700>]}
[0m16:03:46.599318 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.89s]
[0m16:03:46.600412 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m16:03:46.600923 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m16:03:46.600923 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m16:03:46.601554 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m16:03:46.602559 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m16:03:46.605068 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m16:03:46.605068 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m16:03:46.611560 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m16:03:46.613594 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m16:03:46.613594 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m16:03:46.613594 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:46.615101 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:46.616135 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m16:03:46.616135 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m16:03:46.621429 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m16:03:46.626118 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m16:03:46.627122 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m16:03:46.627625 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:46.629302 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m16:03:46.629302 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m16:03:46.630807 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m16:03:46.635855 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m16:03:46.639289 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m16:03:46.639289 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m16:03:46.640792 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:46.642298 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m16:03:46.642298 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF848971D0>]}
[0m16:03:46.643807 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.04s]
[0m16:03:46.644318 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m16:03:46.644318 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m16:03:46.645917 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m16:03:46.646492 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m16:03:46.646492 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m16:03:46.649002 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m16:03:46.651050 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m16:03:46.656317 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m16:03:46.657323 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m16:03:46.657323 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m16:03:46.658327 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:46.658829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:46.658829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m16:03:46.659339 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m16:03:46.693073 [debug] [Thread-1 (]: SQL status: OK in 0.034 seconds
[0m16:03:46.696833 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m16:03:46.697387 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m16:03:46.698413 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:46.698413 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m16:03:46.700053 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m16:03:46.700053 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m16:03:46.708873 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m16:03:46.712172 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m16:03:46.712172 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m16:03:46.713920 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:46.714598 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m16:03:46.715304 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA33D2AE0>]}
[0m16:03:46.716316 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.07s]
[0m16:03:46.716847 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m16:03:46.717417 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m16:03:46.717417 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m16:03:46.717417 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m16:03:46.717417 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m16:03:46.721270 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m16:03:46.722288 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m16:03:46.725822 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m16:03:46.727852 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m16:03:46.727852 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m16:03:46.727852 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:46.728864 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:46.728864 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m16:03:46.728864 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    md5(cast(cast(d.codigo as bigint) as varchar))
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m16:03:47.035454 [debug] [Thread-1 (]: SQL status: OK in 0.305 seconds
[0m16:03:47.038980 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m16:03:47.039753 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m16:03:47.040848 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.042060 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m16:03:47.042060 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m16:03:47.042060 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m16:03:47.223170 [debug] [Thread-1 (]: SQL status: OK in 0.181 seconds
[0m16:03:47.224781 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m16:03:47.224781 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m16:03:47.226415 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.227784 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m16:03:47.227784 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA33BEC90>]}
[0m16:03:47.228812 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.51s]
[0m16:03:47.229812 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m16:03:47.230795 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m16:03:47.231323 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m16:03:47.232947 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m16:03:47.234104 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m16:03:47.234104 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m16:03:47.264346 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m16:03:47.265376 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m16:03:47.267295 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.267295 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.267295 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m16:03:47.268301 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m16:03:47.269300 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.283303 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m16:03:47.284090 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.296333 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m16:03:47.301310 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m16:03:47.303085 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m16:03:47.303085 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m16:03:47.304115 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m16:03:47.306550 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.306550 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m16:03:47.307627 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF8488AD80>]}
[0m16:03:47.307627 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.08s]
[0m16:03:47.309266 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m16:03:47.309266 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m16:03:47.309266 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m16:03:47.310795 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m16:03:47.311798 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m16:03:47.311798 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m16:03:47.315132 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m16:03:47.315132 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m16:03:47.316153 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.316153 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.316153 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m16:03:47.316153 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m16:03:47.316153 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.317932 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m16:03:47.318961 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.320514 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.321880 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m16:03:47.323386 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m16:03:47.325011 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m16:03:47.325011 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m16:03:47.326568 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.327190 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m16:03:47.327737 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF84462FC0>]}
[0m16:03:47.327737 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.02s]
[0m16:03:47.328756 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m16:03:47.328756 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m16:03:47.329741 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m16:03:47.330741 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m16:03:47.330741 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m16:03:47.331246 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m16:03:47.336823 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m16:03:47.337402 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m16:03:47.338415 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.338923 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.339982 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m16:03:47.339982 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m16:03:47.340930 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.341950 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m16:03:47.342455 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.344462 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.344967 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m16:03:47.346479 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m16:03:47.346479 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m16:03:47.346479 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m16:03:47.348099 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.348514 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m16:03:47.349106 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA3403B90>]}
[0m16:03:47.349106 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.02s]
[0m16:03:47.350104 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m16:03:47.350608 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m16:03:47.351281 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m16:03:47.351281 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m16:03:47.353020 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m16:03:47.353620 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m16:03:47.358397 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m16:03:47.358397 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m16:03:47.358397 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.359404 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.359909 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m16:03:47.359909 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m16:03:47.359909 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.360915 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m16:03:47.361922 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.363060 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.363706 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m16:03:47.366086 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m16:03:47.366592 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m16:03:47.366592 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m16:03:47.368258 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.368258 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m16:03:47.369571 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF848EAF30>]}
[0m16:03:47.369571 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.02s]
[0m16:03:47.370603 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m16:03:47.371213 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m16:03:47.371213 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m16:03:47.372218 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m16:03:47.372218 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m16:03:47.372218 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m16:03:47.375050 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m16:03:47.376155 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m16:03:47.376751 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.376751 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.376751 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m16:03:47.376751 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m16:03:47.377867 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.379115 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m16:03:47.379115 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.382234 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.382234 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m16:03:47.385199 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m16:03:47.387216 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m16:03:47.388404 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m16:03:47.390922 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.391930 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m16:03:47.392472 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF848DAA80>]}
[0m16:03:47.392472 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.02s]
[0m16:03:47.393474 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m16:03:47.393474 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m16:03:47.394474 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m16:03:47.394978 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m16:03:47.394978 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m16:03:47.394978 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m16:03:47.398157 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m16:03:47.398157 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m16:03:47.399163 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.399724 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.400732 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m16:03:47.400732 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m16:03:47.401237 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.401237 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m16:03:47.402914 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.404428 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.405543 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m16:03:47.406939 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m16:03:47.407544 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m16:03:47.407544 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m16:03:47.408593 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.409098 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m16:03:47.409613 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF8488F050>]}
[0m16:03:47.409613 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.01s]
[0m16:03:47.410619 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m16:03:47.411124 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m16:03:47.411629 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m16:03:47.411629 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m16:03:47.412724 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m16:03:47.412724 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m16:03:47.416503 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m16:03:47.417626 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m16:03:47.417626 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.417626 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.419445 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m16:03:47.419445 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m16:03:47.419445 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.421008 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m16:03:47.421008 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.423197 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.423197 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m16:03:47.424727 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m16:03:47.424727 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m16:03:47.424727 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m16:03:47.427003 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.427003 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m16:03:47.428043 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF8488EF00>]}
[0m16:03:47.428582 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.02s]
[0m16:03:47.428582 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m16:03:47.429594 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m16:03:47.429594 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m16:03:47.431082 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m16:03:47.431082 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m16:03:47.431082 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m16:03:47.436100 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m16:03:47.437107 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m16:03:47.437107 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.437612 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.437612 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m16:03:47.438303 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m16:03:47.438303 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.439314 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m16:03:47.439314 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.442337 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.443349 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m16:03:47.445444 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m16:03:47.445958 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m16:03:47.445958 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m16:03:47.447555 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.448593 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m16:03:47.448593 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA33C58B0>]}
[0m16:03:47.450619 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.02s]
[0m16:03:47.451192 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m16:03:47.451192 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m16:03:47.451192 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m16:03:47.452768 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m16:03:47.452768 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m16:03:47.453776 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m16:03:47.457574 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m16:03:47.457574 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m16:03:47.457574 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.458607 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.459128 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m16:03:47.459128 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m16:03:47.459128 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.460674 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m16:03:47.460674 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.463711 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:47.464885 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m16:03:47.466413 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m16:03:47.466413 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m16:03:47.466919 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m16:03:47.467423 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.467423 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m16:03:47.467423 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF84873E00>]}
[0m16:03:47.469082 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.01s]
[0m16:03:47.470178 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m16:03:47.470734 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m16:03:47.471288 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m16:03:47.471288 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m16:03:47.472293 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m16:03:47.472293 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m16:03:47.477844 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m16:03:47.478975 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m16:03:47.479989 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.479989 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.479989 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m16:03:47.480967 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m16:03:47.481471 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.483057 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m16:03:47.483057 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m16:03:47.484697 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.485990 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m16:03:47.488088 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m16:03:47.488088 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m16:03:47.488088 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m16:03:47.489099 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.490620 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m16:03:47.491636 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA33EE7E0>]}
[0m16:03:47.492142 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.02s]
[0m16:03:47.492142 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m16:03:47.493148 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m16:03:47.494321 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m16:03:47.494321 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m16:03:47.495457 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m16:03:47.502799 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m16:03:47.503806 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m16:03:47.517345 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m16:03:47.518945 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m16:03:47.518945 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m16:03:47.518945 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.520049 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.520049 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m16:03:47.520671 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.522499 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.524885 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m16:03:47.524885 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m16:03:47.524885 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m16:03:47.526529 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.03s]
[0m16:03:47.527570 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m16:03:47.527570 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m16:03:47.528300 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m16:03:47.529304 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m16:03:47.529304 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m16:03:47.533231 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m16:03:47.533919 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m16:03:47.534942 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m16:03:47.536335 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m16:03:47.536335 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m16:03:47.536335 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.538437 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.539446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m16:03:47.539446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.540953 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.541965 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m16:03:47.543380 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m16:03:47.543380 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m16:03:47.544378 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m16:03:47.544883 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m16:03:47.546395 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m16:03:47.546395 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m16:03:47.547093 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m16:03:47.547093 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m16:03:47.553446 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m16:03:47.555260 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m16:03:47.557767 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m16:03:47.558772 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m16:03:47.560123 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m16:03:47.560123 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.560628 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:47.560628 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m16:03:47.560628 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m16:03:47.564758 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:47.567092 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m16:03:47.568106 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m16:03:47.568106 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m16:03:47.569111 [info ] [Thread-1 (]: 24 of 97 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m16:03:47.569111 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m16:03:47.570867 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m16:03:47.571176 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m16:03:47.571679 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m16:03:47.571679 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m16:03:47.574883 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m16:03:47.574883 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m16:03:47.578993 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m16:03:47.579974 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m16:03:47.579974 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m16:03:47.580977 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.581491 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.581491 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m16:03:47.581491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.583715 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.585227 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m16:03:47.586233 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m16:03:47.586233 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m16:03:47.587232 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m16:03:47.587937 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m16:03:47.587937 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m16:03:47.587937 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m16:03:47.588950 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m16:03:47.588950 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m16:03:47.710056 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m16:03:47.713122 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m16:03:47.719148 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m16:03:47.723372 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m16:03:47.724378 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m16:03:47.724884 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.724884 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.724884 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m16:03:47.726401 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.730620 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:47.733912 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m16:03:47.735778 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m16:03:47.737296 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m16:03:47.739037 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.15s]
[0m16:03:47.741036 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m16:03:47.741036 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m16:03:47.742337 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m16:03:47.743342 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m16:03:47.743342 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m16:03:47.750665 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m16:03:47.752898 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m16:03:47.756418 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m16:03:47.759209 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m16:03:47.759209 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m16:03:47.759209 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.760727 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.761740 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m16:03:47.762252 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m16:03:47.765991 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:47.767595 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m16:03:47.769236 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m16:03:47.769236 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m16:03:47.771665 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.03s]
[0m16:03:47.772693 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m16:03:47.773199 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m16:03:47.773199 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m16:03:47.773199 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m16:03:47.774939 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m16:03:47.781339 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m16:03:47.782922 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m16:03:47.786918 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m16:03:47.787572 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m16:03:47.788304 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m16:03:47.788304 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.789315 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.789315 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m16:03:47.789315 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.790833 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.793377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m16:03:47.794388 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m16:03:47.796208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m16:03:47.797248 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m16:03:47.797956 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m16:03:47.798990 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m16:03:47.798990 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m16:03:47.800485 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m16:03:47.801319 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m16:03:47.806940 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m16:03:47.809597 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m16:03:47.814544 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m16:03:47.816727 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m16:03:47.817230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m16:03:47.817863 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.817863 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.817863 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m16:03:47.817863 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m16:03:47.823339 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m16:03:47.824856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m16:03:47.825861 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m16:03:47.826364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m16:03:47.827035 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.03s]
[0m16:03:47.828071 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m16:03:47.830563 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m16:03:47.831427 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m16:03:47.832588 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m16:03:47.832588 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m16:03:47.837931 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m16:03:47.838937 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m16:03:47.847061 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m16:03:47.848186 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m16:03:47.848186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m16:03:47.849712 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.850728 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.851236 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m16:03:47.851236 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.852814 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.857396 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m16:03:47.858910 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m16:03:47.858910 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m16:03:47.859918 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.03s]
[0m16:03:47.860921 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m16:03:47.861441 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m16:03:47.861441 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m16:03:47.862598 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m16:03:47.863360 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m16:03:47.867424 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m16:03:47.869061 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m16:03:47.873936 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m16:03:47.874985 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m16:03:47.876039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m16:03:47.876039 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.876668 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.877745 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m16:03:47.879283 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.879283 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.883075 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m16:03:47.883587 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m16:03:47.883587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m16:03:47.885153 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m16:03:47.885153 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m16:03:47.886141 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m16:03:47.887142 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m16:03:47.887649 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m16:03:47.888354 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m16:03:47.894626 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m16:03:47.897107 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m16:03:47.900432 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m16:03:47.901042 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m16:03:47.902926 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m16:03:47.904229 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.905246 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.906246 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m16:03:47.906246 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.910016 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:47.912040 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m16:03:47.913642 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m16:03:47.914159 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m16:03:47.915396 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m16:03:47.915396 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m16:03:47.916403 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m16:03:47.916403 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m16:03:47.917779 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m16:03:47.917779 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m16:03:47.924974 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m16:03:47.926733 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m16:03:47.930768 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m16:03:47.931448 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m16:03:47.933098 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m16:03:47.934111 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.935650 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:47.936329 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m16:03:47.937837 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.945379 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m16:03:47.947107 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m16:03:47.947611 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m16:03:47.947611 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m16:03:47.948749 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m16:03:47.948749 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m16:03:47.949622 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m16:03:47.950175 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m16:03:47.950175 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m16:03:47.951575 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m16:03:47.956149 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m16:03:47.957672 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m16:03:47.961002 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m16:03:47.963274 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m16:03:47.964806 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m16:03:47.965325 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.966340 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.966846 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m16:03:47.967351 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.967351 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.968948 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m16:03:47.971844 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m16:03:47.971844 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m16:03:47.973387 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.02s]
[0m16:03:47.974398 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m16:03:47.974907 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m16:03:47.974907 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m16:03:47.976915 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m16:03:47.976915 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m16:03:47.985718 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m16:03:47.987225 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m16:03:47.992235 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m16:03:47.993254 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m16:03:47.994252 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m16:03:47.994252 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:47.996046 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:47.996046 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m16:03:47.997444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:47.998250 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.001485 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m16:03:48.003999 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m16:03:48.003999 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m16:03:48.003999 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.03s]
[0m16:03:48.005134 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m16:03:48.006133 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m16:03:48.006133 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m16:03:48.006133 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m16:03:48.007454 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m16:03:48.015169 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m16:03:48.016390 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m16:03:48.017397 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m16:03:48.018867 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m16:03:48.020450 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m16:03:48.020978 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.021514 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.021514 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m16:03:48.021514 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.024715 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:48.027681 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m16:03:48.028187 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m16:03:48.029196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m16:03:48.029707 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m16:03:48.029707 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m16:03:48.030715 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m16:03:48.031343 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m16:03:48.032352 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m16:03:48.032352 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m16:03:48.036386 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m16:03:48.037388 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m16:03:48.039901 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m16:03:48.040903 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m16:03:48.041428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m16:03:48.041935 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.042960 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.044466 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m16:03:48.045486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.055366 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m16:03:48.057856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m16:03:48.059320 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m16:03:48.059320 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m16:03:48.060964 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m16:03:48.061511 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m16:03:48.062907 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m16:03:48.062907 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m16:03:48.063953 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m16:03:48.064703 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m16:03:48.069482 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m16:03:48.071068 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m16:03:48.074724 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m16:03:48.076312 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m16:03:48.076951 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m16:03:48.076951 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.077966 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.077966 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m16:03:48.079554 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.080577 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.082607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m16:03:48.083651 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m16:03:48.084680 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m16:03:48.085213 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.02s]
[0m16:03:48.086228 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m16:03:48.087804 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m16:03:48.087804 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m16:03:48.088826 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m16:03:48.089826 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m16:03:48.092379 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m16:03:48.094417 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m16:03:48.100978 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m16:03:48.102539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m16:03:48.104208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m16:03:48.104208 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.105216 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.105216 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m16:03:48.106264 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.107393 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.109065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m16:03:48.110694 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m16:03:48.110694 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m16:03:48.111701 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m16:03:48.112895 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m16:03:48.113545 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m16:03:48.114252 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m16:03:48.115269 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m16:03:48.116568 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m16:03:48.126710 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m16:03:48.128515 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m16:03:48.133971 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m16:03:48.135651 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m16:03:48.137161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m16:03:48.137769 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.139774 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:48.139774 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m16:03:48.140797 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.144804 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m16:03:48.146536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m16:03:48.148050 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m16:03:48.149058 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m16:03:48.149058 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m16:03:48.150060 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m16:03:48.150566 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m16:03:48.151168 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m16:03:48.151168 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m16:03:48.151168 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m16:03:48.156390 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m16:03:48.156390 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m16:03:48.160629 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m16:03:48.164141 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m16:03:48.164697 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m16:03:48.165224 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.166256 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.166256 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m16:03:48.167382 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.174769 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m16:03:48.176522 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m16:03:48.177745 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m16:03:48.177745 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m16:03:48.178751 [info ] [Thread-1 (]: 41 of 97 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m16:03:48.179764 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m16:03:48.180749 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m16:03:48.181385 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m16:03:48.181385 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m16:03:48.183006 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m16:03:48.189115 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m16:03:48.192410 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m16:03:48.194500 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m16:03:48.196169 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m16:03:48.196169 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m16:03:48.196793 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.196793 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:48.196793 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m16:03:48.197805 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.198837 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.201038 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m16:03:48.201038 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m16:03:48.202655 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m16:03:48.202655 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.02s]
[0m16:03:48.202655 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m16:03:48.204267 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m16:03:48.205288 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m16:03:48.207543 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m16:03:48.208821 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m16:03:48.213065 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m16:03:48.214527 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m16:03:48.217631 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m16:03:48.219227 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m16:03:48.219227 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m16:03:48.220604 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.222571 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:48.223665 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m16:03:48.224692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.227871 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.229892 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m16:03:48.231418 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m16:03:48.231418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m16:03:48.233015 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.02s]
[0m16:03:48.234033 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m16:03:48.234538 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m16:03:48.234538 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m16:03:48.235546 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m16:03:48.235546 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m16:03:48.246212 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m16:03:48.248173 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m16:03:48.254021 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m16:03:48.256688 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m16:03:48.256688 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m16:03:48.258092 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.259611 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.259611 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m16:03:48.260621 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.266531 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m16:03:48.269548 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m16:03:48.271715 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m16:03:48.271715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m16:03:48.273462 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.04s]
[0m16:03:48.274532 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m16:03:48.274532 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m16:03:48.276124 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m16:03:48.276851 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m16:03:48.276851 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m16:03:48.283329 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m16:03:48.285840 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m16:03:48.288950 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m16:03:48.289948 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m16:03:48.289948 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m16:03:48.290948 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.291454 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:48.291454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m16:03:48.291959 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.297170 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m16:03:48.300321 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m16:03:48.300827 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m16:03:48.301433 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m16:03:48.302442 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m16:03:48.302442 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m16:03:48.304338 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m16:03:48.304338 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m16:03:48.305344 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m16:03:48.306346 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m16:03:48.310884 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m16:03:48.313577 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m16:03:48.316326 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m16:03:48.319012 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m16:03:48.320541 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m16:03:48.320541 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.322057 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.323062 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m16:03:48.323062 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.323062 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.324630 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m16:03:48.326313 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m16:03:48.326313 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m16:03:48.327036 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.02s]
[0m16:03:48.328040 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m16:03:48.328040 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m16:03:48.328547 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m16:03:48.329551 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m16:03:48.329551 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m16:03:48.336014 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m16:03:48.337564 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m16:03:48.339430 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m16:03:48.340957 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m16:03:48.340957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m16:03:48.341370 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.341370 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.342857 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m16:03:48.343395 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.343395 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.348189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m16:03:48.349710 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m16:03:48.350718 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m16:03:48.351223 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m16:03:48.352233 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m16:03:48.352233 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m16:03:48.353707 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m16:03:48.355354 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m16:03:48.356475 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m16:03:48.362859 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m16:03:48.363904 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m16:03:48.366315 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m16:03:48.367330 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m16:03:48.367330 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m16:03:48.367836 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.367836 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.367836 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m16:03:48.368841 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.374879 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m16:03:48.376518 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m16:03:48.377383 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m16:03:48.378031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m16:03:48.379037 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m16:03:48.380559 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m16:03:48.380559 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m16:03:48.380559 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m16:03:48.382083 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m16:03:48.382602 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m16:03:48.392334 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m16:03:48.394843 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m16:03:48.400558 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m16:03:48.402842 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m16:03:48.403856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m16:03:48.404367 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.405378 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.406373 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m16:03:48.407493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.421299 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m16:03:48.424854 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m16:03:48.426394 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m16:03:48.427002 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m16:03:48.428182 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.05s]
[0m16:03:48.429211 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m16:03:48.429211 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m16:03:48.429211 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m16:03:48.431360 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m16:03:48.431360 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m16:03:48.435499 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m16:03:48.437007 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m16:03:48.439173 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m16:03:48.439173 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m16:03:48.440335 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m16:03:48.440846 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.442498 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:48.443513 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m16:03:48.444023 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.444548 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.446799 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m16:03:48.448073 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m16:03:48.449097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m16:03:48.450140 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.02s]
[0m16:03:48.451282 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m16:03:48.451282 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m16:03:48.451282 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m16:03:48.452905 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m16:03:48.452905 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m16:03:48.458376 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m16:03:48.459938 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m16:03:48.464936 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m16:03:48.465444 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m16:03:48.465444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m16:03:48.466447 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.467460 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.468470 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m16:03:48.468978 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.471413 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.473042 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m16:03:48.476230 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m16:03:48.476748 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m16:03:48.477776 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.03s]
[0m16:03:48.478310 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m16:03:48.479306 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m16:03:48.479306 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m16:03:48.480809 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m16:03:48.481383 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m16:03:48.485604 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m16:03:48.487116 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m16:03:48.490974 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m16:03:48.492516 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m16:03:48.493527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m16:03:48.493527 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.493527 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.494525 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m16:03:48.494525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.497763 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:48.498858 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m16:03:48.500364 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m16:03:48.500869 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m16:03:48.501442 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m16:03:48.501442 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m16:03:48.502448 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m16:03:48.502448 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m16:03:48.504204 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m16:03:48.505234 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m16:03:48.510632 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m16:03:48.512140 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m16:03:48.515320 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m16:03:48.516344 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m16:03:48.517820 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m16:03:48.519343 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.521553 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:48.521553 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m16:03:48.521553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.526354 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:48.528471 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m16:03:48.528994 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m16:03:48.530559 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m16:03:48.531573 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m16:03:48.531573 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m16:03:48.531573 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m16:03:48.533267 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m16:03:48.533770 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m16:03:48.533770 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m16:03:48.537206 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m16:03:48.538315 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m16:03:48.540835 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m16:03:48.541843 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m16:03:48.542349 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m16:03:48.542349 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.543381 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.544534 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m16:03:48.544534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.546663 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.547695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m16:03:48.548230 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m16:03:48.548230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m16:03:48.548230 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m16:03:48.549738 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m16:03:48.550745 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m16:03:48.551255 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m16:03:48.551255 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m16:03:48.552933 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m16:03:48.559152 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m16:03:48.560662 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m16:03:48.563398 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m16:03:48.565211 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m16:03:48.566429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m16:03:48.566429 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.567436 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.567436 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m16:03:48.569157 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.570775 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.571368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m16:03:48.573003 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m16:03:48.573003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m16:03:48.573003 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m16:03:48.574646 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m16:03:48.574646 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m16:03:48.574646 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m16:03:48.576994 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m16:03:48.578031 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m16:03:48.586015 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m16:03:48.588098 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m16:03:48.590629 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m16:03:48.590629 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m16:03:48.592247 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m16:03:48.592247 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.592247 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:48.592247 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m16:03:48.594303 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.598018 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:48.601124 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m16:03:48.602723 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m16:03:48.602723 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m16:03:48.602723 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m16:03:48.604404 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m16:03:48.605409 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m16:03:48.606409 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m16:03:48.607483 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m16:03:48.607483 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m16:03:48.613736 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m16:03:48.616336 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m16:03:48.622083 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m16:03:48.624757 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m16:03:48.626439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m16:03:48.627549 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.628247 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.628247 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m16:03:48.629258 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.635582 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m16:03:48.637093 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m16:03:48.638607 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m16:03:48.638607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m16:03:48.639614 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m16:03:48.640644 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m16:03:48.640644 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m16:03:48.642225 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m16:03:48.642225 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m16:03:48.643234 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m16:03:48.647500 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m16:03:48.648585 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m16:03:48.652847 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m16:03:48.653855 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m16:03:48.654362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m16:03:48.654362 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.654362 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.655368 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m16:03:48.655368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.656877 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:48.658385 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m16:03:48.658385 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m16:03:48.659534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m16:03:48.659534 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.02s]
[0m16:03:48.660577 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m16:03:48.660577 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m16:03:48.661584 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m16:03:48.661584 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m16:03:48.661584 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m16:03:48.666350 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m16:03:48.667362 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m16:03:48.669890 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m16:03:48.670395 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m16:03:48.670395 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m16:03:48.671402 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.671910 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.671910 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m16:03:48.672932 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.673964 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.675231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m16:03:48.675231 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m16:03:48.675231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m16:03:48.675231 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m16:03:48.675231 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m16:03:48.677770 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m16:03:48.677770 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m16:03:48.677770 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m16:03:48.677770 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m16:03:48.683106 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m16:03:48.684794 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m16:03:48.689305 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m16:03:48.690813 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m16:03:48.690813 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m16:03:48.692513 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.693525 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.693525 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m16:03:48.694538 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.697083 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m16:03:48.700146 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m16:03:48.701426 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m16:03:48.701426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m16:03:48.701426 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m16:03:48.702453 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m16:03:48.702963 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m16:03:48.702963 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m16:03:48.703970 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m16:03:48.703970 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m16:03:48.709298 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m16:03:48.709838 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m16:03:48.714057 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m16:03:48.715376 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m16:03:48.715376 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m16:03:48.715376 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.716900 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.717405 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m16:03:48.717405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:48.728073 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m16:03:48.730840 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m16:03:48.732001 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m16:03:48.732517 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m16:03:48.733107 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m16:03:48.733771 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m16:03:48.734776 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m16:03:48.735858 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m16:03:48.735858 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m16:03:48.735858 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m16:03:48.738905 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m16:03:48.741975 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m16:03:48.748169 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m16:03:48.749691 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m16:03:48.749691 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m16:03:48.749691 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:48.750700 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:48.750700 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m16:03:48.751210 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m16:03:48.751210 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.756299 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m16:03:48.756299 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m16:03:48.757306 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:48.759101 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m16:03:48.760676 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m16:03:48.760676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m16:03:48.766479 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m16:03:48.767484 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m16:03:48.769076 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m16:03:48.769076 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:48.772265 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m16:03:48.773297 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF848DDF70>]}
[0m16:03:49.748102 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m16:03:49.754285 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.04s]
[0m16:03:49.756296 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m16:03:49.756825 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m16:03:49.757333 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m16:03:49.758338 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m16:03:49.758338 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m16:03:49.764782 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m16:03:49.767333 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m16:03:49.774544 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m16:03:49.776424 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m16:03:49.776934 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m16:03:49.776934 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:49.776934 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.778449 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m16:03:49.778449 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m16:03:49.780457 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.785207 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m16:03:49.785207 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m16:03:49.786211 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.787227 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m16:03:49.787751 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m16:03:49.787751 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m16:03:49.788763 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.792371 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m16:03:49.792371 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m16:03:49.793401 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.794406 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m16:03:49.797007 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF848D8B60>]}
[0m16:03:49.797586 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.04s]
[0m16:03:49.798615 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m16:03:49.798615 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m16:03:49.799591 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m16:03:49.800642 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m16:03:49.801224 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m16:03:49.806379 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m16:03:49.807434 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m16:03:49.810632 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m16:03:49.811645 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m16:03:49.812152 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m16:03:49.812546 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:49.813055 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.814181 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m16:03:49.814181 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m16:03:49.816236 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.827933 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m16:03:49.829351 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m16:03:49.831751 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.835437 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m16:03:49.835437 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m16:03:49.836436 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m16:03:49.837435 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.839562 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m16:03:49.839562 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m16:03:49.840561 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.841067 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m16:03:49.842074 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA338A450>]}
[0m16:03:49.842579 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.04s]
[0m16:03:49.842579 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m16:03:49.842579 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m16:03:49.842579 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m16:03:49.844514 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m16:03:49.844514 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m16:03:49.847624 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m16:03:49.848631 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m16:03:49.852565 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m16:03:49.854929 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m16:03:49.854929 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m16:03:49.854929 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:49.856498 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.856498 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m16:03:49.857123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m16:03:49.858308 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.860390 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m16:03:49.860390 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m16:03:49.861942 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.863772 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m16:03:49.863772 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m16:03:49.864376 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m16:03:49.865382 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.867460 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m16:03:49.867460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m16:03:49.869033 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.870393 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m16:03:49.870393 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA336C710>]}
[0m16:03:49.871398 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m16:03:49.871398 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m16:03:49.871398 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m16:03:49.873088 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m16:03:49.873088 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m16:03:49.874701 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m16:03:49.876838 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m16:03:49.877847 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m16:03:49.881182 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m16:03:49.882874 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m16:03:49.884504 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m16:03:49.884504 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:49.885514 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.885514 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m16:03:49.887022 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m16:03:49.888228 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.889235 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m16:03:49.889235 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m16:03:49.891083 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.892141 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m16:03:49.892141 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m16:03:49.893147 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m16:03:49.894649 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.897668 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m16:03:49.897668 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m16:03:49.899673 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.900684 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m16:03:49.901204 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA345E5D0>]}
[0m16:03:49.901204 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.03s]
[0m16:03:49.901204 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m16:03:49.902963 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m16:03:49.903971 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m16:03:49.905079 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m16:03:49.905079 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m16:03:49.908500 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m16:03:49.909034 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m16:03:49.914179 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m16:03:49.916378 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m16:03:49.917385 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m16:03:49.917385 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:49.918526 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.918930 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m16:03:49.918930 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m16:03:49.919436 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.922011 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m16:03:49.923018 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m16:03:49.923524 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.924530 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m16:03:49.924530 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m16:03:49.924530 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m16:03:49.926124 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.928238 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m16:03:49.928238 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m16:03:49.929255 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.930761 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m16:03:49.930761 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF847525D0>]}
[0m16:03:49.931390 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.03s]
[0m16:03:49.932401 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m16:03:49.932906 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m16:03:49.932906 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m16:03:49.933913 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m16:03:49.935092 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m16:03:49.938295 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m16:03:49.939301 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m16:03:49.941814 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m16:03:49.942844 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m16:03:49.942844 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m16:03:49.942844 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:49.944376 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.944376 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m16:03:49.944376 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m16:03:49.944376 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.947563 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m16:03:49.948957 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m16:03:49.948957 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.950460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m16:03:49.951067 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m16:03:49.951067 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m16:03:49.951067 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.954462 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m16:03:49.955493 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m16:03:49.955493 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.957521 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m16:03:49.957521 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA37A6CC0>]}
[0m16:03:49.958528 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m16:03:49.959032 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m16:03:49.959032 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m16:03:49.959032 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m16:03:49.961560 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m16:03:49.962070 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m16:03:49.965747 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m16:03:49.966288 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m16:03:49.970312 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m16:03:49.971540 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m16:03:49.971540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m16:03:49.971540 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:49.972549 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.972549 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m16:03:49.972549 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m16:03:49.973546 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.976094 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m16:03:49.976094 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m16:03:49.977102 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.978181 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m16:03:49.978181 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m16:03:49.978181 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m16:03:49.979204 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.981319 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m16:03:49.982328 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m16:03:49.982831 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:49.984848 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m16:03:49.985855 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA336F1A0>]}
[0m16:03:49.985855 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.03s]
[0m16:03:49.987359 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m16:03:49.987359 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m16:03:49.987359 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m16:03:49.988365 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m16:03:49.988365 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m16:03:49.990962 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m16:03:49.991969 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m16:03:49.994520 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m16:03:49.996146 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m16:03:49.996560 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m16:03:49.996560 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:49.998070 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:49.999080 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m16:03:49.999080 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m16:03:50.000077 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.002882 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m16:03:50.002882 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m16:03:50.002882 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.005065 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m16:03:50.005065 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m16:03:50.005065 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m16:03:50.006668 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.008983 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m16:03:50.008983 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m16:03:50.008983 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.010495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m16:03:50.011516 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF83FEF230>]}
[0m16:03:50.011516 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m16:03:50.011516 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m16:03:50.012888 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m16:03:50.013431 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m16:03:50.013845 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m16:03:50.013845 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m16:03:50.016376 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m16:03:50.017384 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m16:03:50.021909 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m16:03:50.022914 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m16:03:50.022914 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m16:03:50.023380 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.023920 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.023920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m16:03:50.023920 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m16:03:50.025991 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.027840 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m16:03:50.028846 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m16:03:50.028846 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.030373 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m16:03:50.030905 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m16:03:50.030905 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m16:03:50.033560 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:50.036421 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m16:03:50.036421 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m16:03:50.036942 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.038079 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m16:03:50.039114 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA338EF00>]}
[0m16:03:50.039114 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m16:03:50.039114 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m16:03:50.039114 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m16:03:50.040623 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m16:03:50.041146 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m16:03:50.042153 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m16:03:50.045783 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m16:03:50.046875 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m16:03:50.048974 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m16:03:50.048974 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m16:03:50.049974 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m16:03:50.049974 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.050480 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.050993 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m16:03:50.050993 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m16:03:50.050993 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.053712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m16:03:50.054725 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m16:03:50.054725 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m16:03:50.054725 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m16:03:50.054725 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m16:03:50.056248 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m16:03:50.056248 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m16:03:50.057254 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m16:03:50.057254 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m16:03:50.060359 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m16:03:50.062488 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m16:03:50.065284 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m16:03:50.066289 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m16:03:50.066289 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m16:03:50.066289 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.067335 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.067335 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m16:03:50.067335 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:50.069909 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.070418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m16:03:50.071930 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m16:03:50.071930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m16:03:50.071930 [info ] [Thread-1 (]: 73 of 97 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m16:03:50.072947 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m16:03:50.072947 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m16:03:50.072947 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m16:03:50.074541 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m16:03:50.074541 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m16:03:50.077717 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m16:03:50.078371 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m16:03:50.080924 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m16:03:50.081501 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m16:03:50.081501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m16:03:50.082524 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.083052 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.083052 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m16:03:50.083694 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m16:03:50.084708 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.086162 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m16:03:50.087143 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m16:03:50.087648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m16:03:50.088220 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m16:03:50.089240 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m16:03:50.089240 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m16:03:50.089240 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m16:03:50.089240 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m16:03:50.090749 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m16:03:50.096584 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m16:03:50.098095 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m16:03:50.099597 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m16:03:50.101111 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m16:03:50.101111 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m16:03:50.101111 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.102702 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.102702 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m16:03:50.103709 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m16:03:50.104216 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.106724 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m16:03:50.107731 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m16:03:50.108402 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m16:03:50.109233 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.02s]
[0m16:03:50.109233 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m16:03:50.109233 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m16:03:50.109233 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m16:03:50.110745 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m16:03:50.110745 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m16:03:50.115714 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m16:03:50.116811 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m16:03:50.117971 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m16:03:50.119492 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m16:03:50.119492 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m16:03:50.119492 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.120521 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.120521 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m16:03:50.120521 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:50.122151 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:03:50.124668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m16:03:50.125171 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m16:03:50.125171 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m16:03:50.126174 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m16:03:50.126174 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m16:03:50.126786 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m16:03:50.126786 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m16:03:50.126786 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m16:03:50.127792 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m16:03:50.131397 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m16:03:50.131912 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m16:03:50.134438 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m16:03:50.135956 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m16:03:50.135956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m16:03:50.135956 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.137004 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.137004 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m16:03:50.137555 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m16:03:50.138253 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.140284 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m16:03:50.140810 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m16:03:50.140810 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m16:03:50.140810 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m16:03:50.142471 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m16:03:50.142471 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m16:03:50.142471 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m16:03:50.143475 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m16:03:50.143475 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m16:03:50.146611 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m16:03:50.147643 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m16:03:50.149627 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m16:03:50.150632 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m16:03:50.150632 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m16:03:50.151165 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.151165 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.151165 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m16:03:50.151165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m16:03:50.152952 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:50.153958 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m16:03:50.154462 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m16:03:50.154462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m16:03:50.155465 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m16:03:50.155465 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m16:03:50.155465 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m16:03:50.156466 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m16:03:50.156980 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m16:03:50.157662 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m16:03:50.160687 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m16:03:50.162759 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m16:03:50.167753 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m16:03:50.168259 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m16:03:50.169265 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m16:03:50.169265 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.169265 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.171196 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m16:03:50.171196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:03:50.172242 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.173711 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m16:03:50.174718 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m16:03:50.174718 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m16:03:50.174718 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m16:03:50.176379 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m16:03:50.176379 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m16:03:50.176968 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m16:03:50.176968 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m16:03:50.176968 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m16:03:50.180602 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m16:03:50.181609 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m16:03:50.183228 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m16:03:50.184372 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m16:03:50.184876 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m16:03:50.184876 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.185884 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.185884 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m16:03:50.185884 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m16:03:50.188404 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.189498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m16:03:50.190473 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m16:03:50.190975 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m16:03:50.190975 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m16:03:50.191980 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m16:03:50.192484 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m16:03:50.192484 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m16:03:50.193489 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m16:03:50.193489 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m16:03:50.196591 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m16:03:50.197599 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m16:03:50.200566 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m16:03:50.201231 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m16:03:50.201231 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m16:03:50.202847 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:50.202847 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:03:50.203852 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m16:03:50.204356 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m16:03:58.837914 [debug] [Thread-1 (]: SQL status: OK in 8.633 seconds
[0m16:03:58.840918 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m16:03:58.841422 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m16:03:58.841926 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:58.842956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m16:03:58.842956 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m16:03:58.842956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m16:03:58.991565 [debug] [Thread-1 (]: SQL status: OK in 0.147 seconds
[0m16:03:58.993610 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m16:03:58.994115 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m16:03:58.994115 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:58.995142 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m16:03:58.996136 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA33DBE60>]}
[0m16:03:58.996677 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 8.80s]
[0m16:03:58.996677 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m16:03:58.997673 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m16:03:58.997673 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m16:03:58.998774 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m16:03:58.998774 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m16:03:59.002429 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m16:03:59.003942 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m16:03:59.006967 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m16:03:59.007482 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m16:03:59.008489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m16:03:59.008489 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:59.008995 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:59.008995 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m16:03:59.008995 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m16:03:59.159325 [debug] [Thread-1 (]: SQL status: OK in 0.150 seconds
[0m16:03:59.163574 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m16:03:59.164792 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m16:03:59.165433 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:59.166464 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m16:03:59.166998 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m16:03:59.166998 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m16:03:59.173133 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m16:03:59.174693 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m16:03:59.175229 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m16:03:59.175229 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:59.176252 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m16:03:59.177035 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA3818E30>]}
[0m16:03:59.177035 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.18s]
[0m16:03:59.178038 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m16:03:59.178038 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m16:03:59.179186 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m16:03:59.179186 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m16:03:59.179186 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m16:03:59.184172 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m16:03:59.184827 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m16:03:59.187657 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m16:03:59.188345 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m16:03:59.188345 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m16:03:59.189349 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:03:59.189349 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:03:59.189349 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m16:03:59.189349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m16:04:13.862639 [debug] [Thread-1 (]: SQL status: OK in 14.672 seconds
[0m16:04:13.866110 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m16:04:13.866110 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m16:04:13.867627 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:13.870696 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m16:04:13.871710 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m16:04:13.872708 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m16:04:13.931374 [debug] [Thread-1 (]: SQL status: OK in 0.058 seconds
[0m16:04:13.934453 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m16:04:13.934453 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m16:04:13.935484 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:04:13.935484 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m16:04:13.937022 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF84890EF0>]}
[0m16:04:13.937619 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 14.76s]
[0m16:04:13.938196 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m16:04:13.938196 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m16:04:13.939205 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m16:04:13.939205 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m16:04:13.939205 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m16:04:13.943323 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m16:04:13.944819 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m16:04:13.947513 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m16:04:13.948116 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m16:04:13.948116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m16:04:13.949734 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:13.949734 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:13.949734 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m16:04:13.950765 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m16:04:14.197684 [debug] [Thread-1 (]: SQL status: OK in 0.247 seconds
[0m16:04:14.200752 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m16:04:14.200752 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m16:04:14.201522 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:04:14.203060 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m16:04:14.203060 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m16:04:14.203060 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m16:04:14.212406 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m16:04:14.215648 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m16:04:14.216239 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m16:04:14.217250 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:04:14.217758 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m16:04:14.219264 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA383DF40>]}
[0m16:04:14.219264 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.28s]
[0m16:04:14.219264 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m16:04:14.219264 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m16:04:14.220677 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m16:04:14.221305 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m16:04:14.221305 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m16:04:14.226466 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m16:04:14.227076 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m16:04:14.232778 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m16:04:14.233860 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m16:04:14.234407 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m16:04:14.234407 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.235421 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.236415 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m16:04:14.237416 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m16:04:14.593498 [debug] [Thread-1 (]: SQL status: OK in 0.356 seconds
[0m16:04:14.596051 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m16:04:14.596051 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m16:04:14.596051 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m16:04:14.597856 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m16:04:14.597856 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m16:04:14.598865 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m16:04:14.662285 [debug] [Thread-1 (]: SQL status: OK in 0.063 seconds
[0m16:04:14.665249 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m16:04:14.666269 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m16:04:14.667798 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.669864 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m16:04:14.670386 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '56202cae-31b1-40cf-8aab-82af5a7a993e', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA33BEF30>]}
[0m16:04:14.670922 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.45s]
[0m16:04:14.671463 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m16:04:14.671463 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m16:04:14.671463 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m16:04:14.673245 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m16:04:14.674910 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m16:04:14.678328 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m16:04:14.681382 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m16:04:14.685740 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m16:04:14.690509 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m16:04:14.690509 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m16:04:14.692664 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.693669 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.694666 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m16:04:14.694666 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m16:04:14.697888 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.701570 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m16:04:14.705130 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m16:04:14.707125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m16:04:14.708801 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.03s]
[0m16:04:14.710815 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m16:04:14.711873 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m16:04:14.712628 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m16:04:14.715291 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m16:04:14.717037 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m16:04:14.727846 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m16:04:14.729366 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m16:04:14.734911 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m16:04:14.737424 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m16:04:14.739086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m16:04:14.739086 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.741136 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.742672 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m16:04:14.744185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:04:14.746206 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:04:14.748715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m16:04:14.748715 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m16:04:14.749710 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m16:04:14.749710 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.04s]
[0m16:04:14.752457 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m16:04:14.752978 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m16:04:14.753990 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m16:04:14.754522 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m16:04:14.754522 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m16:04:14.761922 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m16:04:14.763678 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m16:04:14.770107 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m16:04:14.773156 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m16:04:14.775601 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m16:04:14.775942 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.777986 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:04:14.779000 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m16:04:14.782097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m16:04:14.787108 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m16:04:14.790788 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m16:04:14.793348 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m16:04:14.794348 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m16:04:14.795891 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.04s]
[0m16:04:14.797586 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m16:04:14.799111 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m16:04:14.800622 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m16:04:14.801651 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m16:04:14.801651 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m16:04:14.812773 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m16:04:14.815311 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m16:04:14.820368 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m16:04:14.822984 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m16:04:14.825043 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m16:04:14.827282 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.829017 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:04:14.829017 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m16:04:14.831090 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:04:14.832784 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.837410 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m16:04:14.839650 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m16:04:14.841157 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m16:04:14.843188 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.04s]
[0m16:04:14.843188 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m16:04:14.845003 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m16:04:14.846014 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m16:04:14.847555 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m16:04:14.849181 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m16:04:14.859178 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m16:04:14.862401 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m16:04:14.865258 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m16:04:14.866446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m16:04:14.867451 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m16:04:14.867451 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.869316 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:04:14.870861 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m16:04:14.871410 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:04:14.873040 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.874556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m16:04:14.876278 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m16:04:14.876911 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m16:04:14.877920 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.03s]
[0m16:04:14.879476 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m16:04:14.879476 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m16:04:14.880487 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m16:04:14.880995 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m16:04:14.881617 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m16:04:14.887979 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m16:04:14.891345 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m16:04:14.896605 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m16:04:14.898130 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m16:04:14.898130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m16:04:14.898130 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.900655 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.901174 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m16:04:14.901174 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m16:04:14.904315 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.906371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m16:04:14.909311 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m16:04:14.909311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m16:04:14.911853 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.03s]
[0m16:04:14.913585 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m16:04:14.915726 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m16:04:14.916327 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m16:04:14.917874 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m16:04:14.917874 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m16:04:14.924691 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m16:04:14.928162 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m16:04:14.934002 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m16:04:14.934584 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m16:04:14.935613 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m16:04:14.935613 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.937702 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:04:14.938351 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m16:04:14.939362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:04:14.939362 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.942391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m16:04:14.944393 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m16:04:14.947137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m16:04:14.947724 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.03s]
[0m16:04:14.949738 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m16:04:14.949738 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m16:04:14.951535 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m16:04:14.952545 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m16:04:14.954345 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m16:04:14.964696 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m16:04:14.967664 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m16:04:14.974799 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m16:04:14.974799 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m16:04:14.977277 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m16:04:14.977947 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:14.978957 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.978957 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m16:04:14.980463 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:04:14.981585 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:14.983949 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m16:04:14.985630 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m16:04:14.985630 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m16:04:14.987747 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.04s]
[0m16:04:14.989427 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m16:04:14.989427 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m16:04:14.989427 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m16:04:14.990939 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m16:04:14.991948 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m16:04:14.998141 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m16:04:14.999661 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m16:04:15.003807 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m16:04:15.005330 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m16:04:15.006837 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m16:04:15.007349 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:15.008870 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:15.009382 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m16:04:15.009909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m16:04:15.011955 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:15.015074 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m16:04:15.017245 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m16:04:15.019284 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m16:04:15.020844 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.03s]
[0m16:04:15.023524 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m16:04:15.024574 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m16:04:15.024574 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m16:04:15.026887 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m16:04:15.026887 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m16:04:15.035525 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m16:04:15.037073 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m16:04:15.039287 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m16:04:15.040799 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m16:04:15.040799 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m16:04:15.040799 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:15.042818 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m16:04:15.042818 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m16:04:15.044531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m16:04:15.051006 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m16:04:15.054160 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m16:04:15.055168 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m16:04:15.057437 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m16:04:15.058965 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.03s]
[0m16:04:15.060499 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m16:04:15.062684 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m16:04:15.064458 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m16:04:15.066517 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m16:04:15.066517 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m16:04:15.077083 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m16:04:15.078305 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m16:04:15.084654 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m16:04:15.087717 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m16:04:15.088336 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m16:04:15.088336 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:15.089352 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:15.090861 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m16:04:15.092388 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m16:04:15.094398 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:15.095911 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m16:04:15.097637 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m16:04:15.098649 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m16:04:15.100163 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.03s]
[0m16:04:15.100670 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m16:04:15.101277 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m16:04:15.101277 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m16:04:15.101277 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m16:04:15.102892 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m16:04:15.106099 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m16:04:15.107829 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m16:04:15.112520 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m16:04:15.115242 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m16:04:15.116771 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m16:04:15.117278 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m16:04:15.118288 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:15.118288 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m16:04:15.118288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m16:04:15.119315 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m16:04:15.121511 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m16:04:15.121511 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m16:04:15.123122 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m16:04:15.123122 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.02s]
[0m16:04:15.124759 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m16:04:15.126928 [debug] [MainThread]: Using duckdb connection "master"
[0m16:04:15.126928 [debug] [MainThread]: On master: BEGIN
[0m16:04:15.127934 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m16:04:15.128441 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m16:04:15.128441 [debug] [MainThread]: On master: COMMIT
[0m16:04:15.129450 [debug] [MainThread]: Using duckdb connection "master"
[0m16:04:15.129450 [debug] [MainThread]: On master: COMMIT
[0m16:04:15.129450 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m16:04:15.129450 [debug] [MainThread]: On master: Close
[0m16:04:15.131009 [debug] [MainThread]: Connection 'master' was properly closed.
[0m16:04:15.131701 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m16:04:15.133360 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m16:04:15.133360 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m16:04:15.134720 [info ] [MainThread]: 
[0m16:04:15.135725 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 38.35 seconds (38.35s).
[0m16:04:15.154283 [debug] [MainThread]: Command end result
[0m16:04:15.218943 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m16:04:15.223362 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m16:04:15.235751 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m16:04:15.235751 [info ] [MainThread]: 
[0m16:04:15.237264 [info ] [MainThread]: [32mCompleted successfully[0m
[0m16:04:15.237960 [info ] [MainThread]: 
[0m16:04:15.239973 [info ] [MainThread]: Done. PASS=97 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=97
[0m16:04:15.240531 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 22 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m16:04:15.241053 [debug] [MainThread]: Command `dbt build` succeeded at 16:04:15.241053 after 42.56 seconds
[0m16:04:15.242062 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF829879E0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CF848DFAA0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001CFA344CE60>]}
[0m16:04:15.242577 [debug] [MainThread]: Flushing usage events
[0m16:04:16.054676 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m20:59:55.993916 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000023619CAE810>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000023619CACF80>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361A15EEA0>]}


============================== 20:59:56.001308 | 6661c3ac-ffae-49ee-be2f-fc550f47c242 ==============================
[0m20:59:56.001308 [info ] [MainThread]: Running with dbt=1.11.5
[0m20:59:56.001308 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'fail_fast': 'False', 'debug': 'False', 'log_format': 'default', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'use_colors': 'True', 'indirect_selection': 'eager', 'invocation_command': 'dbt build', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m20:59:56.216710 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361B82D4C0>]}
[0m20:59:56.263825 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000236172AE1B0>]}
[0m20:59:56.279538 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m20:59:56.745731 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m20:59:59.902615 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
[0m20:59:59.904450 [debug] [MainThread]: Nothing changed, skipping partial parsing.
[0m20:59:59.904450 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing
[0m20:59:59.917760 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m20:59:59.955476 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361B92CE30>]}
[0m21:00:00.035223 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m21:00:00.051387 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m21:00:00.147291 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361BD23C20>]}
[0m21:00:00.148351 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m21:00:00.158434 [info ] [MainThread]: 
[0m21:00:00.160065 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m21:00:00.160656 [info ] [MainThread]: 
[0m21:00:00.161270 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m21:00:00.165982 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m21:00:04.051474 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m21:00:04.051474 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m21:00:04.051474 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m21:00:04.636819 [debug] [ThreadPool]: SQL status: OK in 0.585 seconds
[0m21:00:04.638324 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m21:00:04.639330 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m21:00:04.639834 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m21:00:04.645387 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m21:00:04.645387 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m21:00:04.645387 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m21:00:04.646973 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m21:00:04.647993 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m21:00:04.647993 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m21:00:04.648519 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m21:00:04.648519 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m21:00:04.648519 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m21:00:04.649558 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m21:00:04.650214 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m21:00:04.650214 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m21:00:04.650214 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m21:00:04.651330 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m21:00:04.651330 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m21:00:04.652854 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m21:00:04.657588 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m21:00:04.657588 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m21:00:04.657588 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m21:00:04.658588 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m21:00:04.658588 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m21:00:04.658588 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m21:00:04.670886 [debug] [ThreadPool]: SQL status: OK in 0.012 seconds
[0m21:00:04.670886 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m21:00:04.685032 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m21:00:04.685610 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m21:00:04.685610 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000023617CF4650>]}
[0m21:00:04.686624 [debug] [MainThread]: Using duckdb connection "master"
[0m21:00:04.686624 [debug] [MainThread]: On master: BEGIN
[0m21:00:04.686624 [debug] [MainThread]: Opening a new connection, currently in state init
[0m21:00:04.687622 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m21:00:04.687622 [debug] [MainThread]: On master: COMMIT
[0m21:00:04.687622 [debug] [MainThread]: Using duckdb connection "master"
[0m21:00:04.688174 [debug] [MainThread]: On master: COMMIT
[0m21:00:04.688174 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m21:00:04.688174 [debug] [MainThread]: On master: Close
[0m21:00:04.693079 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m21:00:04.693079 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m21:00:04.694084 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m21:00:04.694084 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m21:00:04.706483 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m21:00:04.708563 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m21:00:04.730849 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m21:00:04.731881 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m21:00:04.731881 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m21:00:04.731881 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m21:00:04.733335 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:04.733842 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m21:00:04.733842 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    md5(cast(cast(codigo_origem as bigint) as varchar))
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
QUALIFY row_number() OVER (PARTITION BY codigo_origem ORDER BY tipo_instituicao) = 1
    );
  
  
[0m21:00:05.221739 [debug] [Thread-1 (]: SQL status: OK in 0.487 seconds
[0m21:00:05.225771 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m21:00:05.226780 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m21:00:05.227973 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:05.236714 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m21:00:05.236714 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m21:00:05.237717 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m21:00:05.242429 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m21:00:05.246942 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m21:00:05.246942 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m21:00:05.247953 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:05.249615 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m21:00:05.251149 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361B888140>]}
[0m21:00:05.252202 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.56s]
[0m21:00:05.253156 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m21:00:05.253663 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m21:00:05.254179 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m21:00:05.255181 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m21:00:05.255699 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m21:00:05.259860 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m21:00:05.261434 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m21:00:05.263562 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m21:00:05.264584 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m21:00:05.264584 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m21:00:05.264584 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:05.266622 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:05.266622 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m21:00:05.266622 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m21:00:05.333765 [debug] [Thread-1 (]: SQL status: OK in 0.066 seconds
[0m21:00:05.335941 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m21:00:05.335941 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m21:00:05.335941 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:05.336953 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m21:00:05.337969 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m21:00:05.337969 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m21:00:05.339728 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:05.340739 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m21:00:05.340739 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m21:00:05.342279 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:05.343480 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m21:00:05.343480 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361BAFA810>]}
[0m21:00:05.343480 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.09s]
[0m21:00:05.344487 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m21:00:05.344487 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m21:00:05.345519 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m21:00:05.345519 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m21:00:05.345519 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m21:00:05.352687 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m21:00:05.354274 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m21:00:05.356793 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m21:00:05.356793 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m21:00:05.356793 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m21:00:05.356793 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:05.358299 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:05.358299 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m21:00:05.358299 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m21:00:05.420886 [debug] [Thread-1 (]: SQL status: OK in 0.061 seconds
[0m21:00:05.422429 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m21:00:05.422429 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m21:00:05.423458 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:05.423458 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m21:00:05.424994 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m21:00:05.424994 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m21:00:05.427204 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:05.428849 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m21:00:05.428849 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m21:00:05.428849 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:05.429832 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m21:00:05.431037 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C2A6720>]}
[0m21:00:05.431037 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.08s]
[0m21:00:05.432050 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m21:00:05.432050 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m21:00:05.432050 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m21:00:05.432050 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m21:00:05.433422 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m21:00:05.438551 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m21:00:05.439578 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m21:00:05.441892 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m21:00:05.443474 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m21:00:05.443474 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m21:00:05.443474 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:05.444488 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:05.444488 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m21:00:05.445503 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m21:00:05.999972 [debug] [Thread-1 (]: SQL status: OK in 0.554 seconds
[0m21:00:06.001977 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m21:00:06.002992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m21:00:06.002992 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.004150 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m21:00:06.004150 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m21:00:06.004150 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m21:00:06.106843 [debug] [Thread-1 (]: SQL status: OK in 0.103 seconds
[0m21:00:06.109948 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m21:00:06.110511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m21:00:06.111097 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.111739 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m21:00:06.111739 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C29BF20>]}
[0m21:00:06.112771 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.68s]
[0m21:00:06.112771 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m21:00:06.112771 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m21:00:06.114069 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m21:00:06.114636 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m21:00:06.114636 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m21:00:06.116994 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m21:00:06.118160 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m21:00:06.120182 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m21:00:06.120716 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m21:00:06.120716 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m21:00:06.120716 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:06.120716 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.122399 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m21:00:06.122399 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m21:00:06.278405 [debug] [Thread-1 (]: SQL status: OK in 0.156 seconds
[0m21:00:06.281048 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m21:00:06.282173 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m21:00:06.282799 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.283917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m21:00:06.283917 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m21:00:06.283917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m21:00:06.293406 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m21:00:06.295388 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m21:00:06.297064 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m21:00:06.297064 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.298608 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m21:00:06.298608 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C3C6C90>]}
[0m21:00:06.299638 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.18s]
[0m21:00:06.300413 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m21:00:06.300944 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m21:00:06.300944 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m21:00:06.301950 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m21:00:06.301950 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m21:00:06.305581 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m21:00:06.307598 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m21:00:06.313653 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m21:00:06.315452 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m21:00:06.315452 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m21:00:06.315452 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:06.315452 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:06.317161 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m21:00:06.317851 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m21:00:06.361409 [debug] [Thread-1 (]: SQL status: OK in 0.042 seconds
[0m21:00:06.363612 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m21:00:06.363612 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m21:00:06.364622 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.365648 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m21:00:06.366158 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m21:00:06.366158 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m21:00:06.384028 [debug] [Thread-1 (]: SQL status: OK in 0.017 seconds
[0m21:00:06.386755 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m21:00:06.386755 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m21:00:06.386755 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.388258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m21:00:06.388258 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C38FEF0>]}
[0m21:00:06.388258 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.09s]
[0m21:00:06.390252 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m21:00:06.390757 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m21:00:06.390757 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m21:00:06.390757 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m21:00:06.390757 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m21:00:06.395460 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m21:00:06.396391 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m21:00:06.398563 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m21:00:06.398563 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m21:00:06.399569 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m21:00:06.399569 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:06.399569 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.399569 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m21:00:06.401005 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m21:00:06.451077 [debug] [Thread-1 (]: SQL status: OK in 0.050 seconds
[0m21:00:06.452601 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m21:00:06.454305 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m21:00:06.454305 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.456009 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m21:00:06.456009 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m21:00:06.456009 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m21:00:06.515727 [debug] [Thread-1 (]: SQL status: OK in 0.060 seconds
[0m21:00:06.518267 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m21:00:06.518267 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m21:00:06.518267 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.519809 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m21:00:06.519809 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361BAFB020>]}
[0m21:00:06.520820 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.13s]
[0m21:00:06.520820 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m21:00:06.520820 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m21:00:06.520820 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m21:00:06.522326 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m21:00:06.522326 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m21:00:06.526914 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m21:00:06.528133 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m21:00:06.530823 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m21:00:06.531888 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m21:00:06.531888 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m21:00:06.531888 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:06.532919 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:06.532919 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m21:00:06.533917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m21:00:07.035964 [debug] [Thread-1 (]: SQL status: OK in 0.503 seconds
[0m21:00:07.040942 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m21:00:07.040942 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m21:00:07.042452 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.043477 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m21:00:07.043477 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m21:00:07.043477 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m21:00:07.175626 [debug] [Thread-1 (]: SQL status: OK in 0.132 seconds
[0m21:00:07.178402 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m21:00:07.179427 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m21:00:07.179963 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.181089 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m21:00:07.181089 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AE34890>]}
[0m21:00:07.182104 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.66s]
[0m21:00:07.182104 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m21:00:07.182104 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m21:00:07.183445 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m21:00:07.183445 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m21:00:07.183445 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m21:00:07.186609 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m21:00:07.188145 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m21:00:07.191285 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m21:00:07.192290 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m21:00:07.192936 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m21:00:07.192936 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.193838 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.193838 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m21:00:07.193838 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m21:00:07.199964 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m21:00:07.202991 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m21:00:07.202991 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m21:00:07.204138 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.204138 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m21:00:07.204138 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m21:00:07.205856 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m21:00:07.208930 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m21:00:07.211083 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m21:00:07.211083 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m21:00:07.211749 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.212781 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m21:00:07.212781 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C3C7AA0>]}
[0m21:00:07.212781 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.03s]
[0m21:00:07.214021 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m21:00:07.215026 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m21:00:07.215026 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m21:00:07.215531 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m21:00:07.216539 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m21:00:07.218391 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m21:00:07.219594 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m21:00:07.223000 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m21:00:07.224006 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m21:00:07.225000 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m21:00:07.225000 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.225504 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.225504 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m21:00:07.225504 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    md5(cast(cast(codigo as bigint) as varchar))
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m21:00:07.251479 [debug] [Thread-1 (]: SQL status: OK in 0.025 seconds
[0m21:00:07.254058 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m21:00:07.254058 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m21:00:07.254058 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.255629 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m21:00:07.255629 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m21:00:07.256655 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m21:00:07.262608 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m21:00:07.265883 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m21:00:07.265883 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m21:00:07.266890 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.267484 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m21:00:07.268102 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AE4BDD0>]}
[0m21:00:07.268102 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.05s]
[0m21:00:07.269116 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m21:00:07.269116 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m21:00:07.269664 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m21:00:07.269664 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m21:00:07.269664 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m21:00:07.273212 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m21:00:07.274192 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m21:00:07.277220 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m21:00:07.278775 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m21:00:07.278775 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m21:00:07.278775 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.279773 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.280279 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m21:00:07.280279 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    md5(cast(cast(d.codigo as bigint) as varchar))
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m21:00:07.537603 [debug] [Thread-1 (]: SQL status: OK in 0.256 seconds
[0m21:00:07.538300 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m21:00:07.539972 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m21:00:07.539972 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.540984 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m21:00:07.540984 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m21:00:07.542165 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m21:00:07.682166 [debug] [Thread-1 (]: SQL status: OK in 0.140 seconds
[0m21:00:07.684283 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m21:00:07.684283 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m21:00:07.684283 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.685277 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m21:00:07.686290 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C28D9D0>]}
[0m21:00:07.686290 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.42s]
[0m21:00:07.687278 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m21:00:07.687278 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m21:00:07.688279 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m21:00:07.688279 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m21:00:07.688279 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m21:00:07.689279 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m21:00:07.705801 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m21:00:07.705801 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m21:00:07.705801 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.706820 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.706820 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m21:00:07.706820 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m21:00:07.706820 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.714697 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m21:00:07.715708 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.722203 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m21:00:07.725730 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m21:00:07.727891 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m21:00:07.728897 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m21:00:07.728897 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m21:00:07.731088 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:07.732095 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m21:00:07.732095 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C3DB560>]}
[0m21:00:07.732601 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.04s]
[0m21:00:07.733606 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m21:00:07.733606 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m21:00:07.733606 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m21:00:07.733606 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m21:00:07.735111 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m21:00:07.735111 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m21:00:07.738135 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m21:00:07.738640 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m21:00:07.738640 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.738640 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.739646 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m21:00:07.739646 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m21:00:07.740151 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.741158 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m21:00:07.741158 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.743156 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.743156 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m21:00:07.744157 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m21:00:07.745157 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m21:00:07.745157 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m21:00:07.746156 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.747322 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m21:00:07.747322 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C3BCDA0>]}
[0m21:00:07.747322 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.01s]
[0m21:00:07.748747 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m21:00:07.748747 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m21:00:07.749751 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m21:00:07.750255 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m21:00:07.750255 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m21:00:07.750255 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m21:00:07.754605 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m21:00:07.754605 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m21:00:07.755612 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.756118 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.756118 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m21:00:07.756623 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m21:00:07.756623 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.757630 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m21:00:07.757630 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.760139 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.760794 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m21:00:07.762495 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m21:00:07.762495 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m21:00:07.763025 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m21:00:07.763860 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.764563 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m21:00:07.765069 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361BD961B0>]}
[0m21:00:07.765575 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.02s]
[0m21:00:07.765575 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m21:00:07.765575 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m21:00:07.766580 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m21:00:07.767170 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m21:00:07.767675 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m21:00:07.767675 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m21:00:07.770830 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m21:00:07.770830 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m21:00:07.770830 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.770830 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.770830 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m21:00:07.770830 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m21:00:07.772665 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.773364 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m21:00:07.773364 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.775358 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.775358 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m21:00:07.777616 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m21:00:07.778239 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m21:00:07.778239 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m21:00:07.780784 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.781397 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m21:00:07.781397 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AE7BD70>]}
[0m21:00:07.781397 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.01s]
[0m21:00:07.783097 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m21:00:07.783097 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m21:00:07.783097 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m21:00:07.784133 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m21:00:07.784133 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m21:00:07.785128 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m21:00:07.788476 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m21:00:07.788476 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m21:00:07.788476 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.788476 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.790263 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m21:00:07.790263 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m21:00:07.791503 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.792187 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m21:00:07.792187 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.794424 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:07.794424 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m21:00:07.796351 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m21:00:07.797377 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m21:00:07.798116 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m21:00:07.798661 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.800180 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m21:00:07.800180 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C29CE00>]}
[0m21:00:07.800180 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.02s]
[0m21:00:07.801186 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m21:00:07.801186 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m21:00:07.801186 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m21:00:07.802717 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m21:00:07.802717 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m21:00:07.802717 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m21:00:07.806708 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m21:00:07.806708 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m21:00:07.806708 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.806708 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.808219 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m21:00:07.808648 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m21:00:07.810234 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.811369 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m21:00:07.811369 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.815680 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m21:00:07.816697 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m21:00:07.818539 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m21:00:07.819215 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m21:00:07.819215 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m21:00:07.820726 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.820726 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m21:00:07.822247 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361BD97890>]}
[0m21:00:07.822247 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.02s]
[0m21:00:07.823259 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m21:00:07.823259 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m21:00:07.824259 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m21:00:07.824259 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m21:00:07.824259 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m21:00:07.825260 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m21:00:07.828283 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m21:00:07.828283 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m21:00:07.828283 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.828283 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.829869 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m21:00:07.829869 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m21:00:07.829869 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.831381 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m21:00:07.831381 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.832893 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:07.833893 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m21:00:07.835396 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m21:00:07.835396 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m21:00:07.836407 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m21:00:07.837908 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.838524 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m21:00:07.838524 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C3812B0>]}
[0m21:00:07.838524 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.01s]
[0m21:00:07.838524 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m21:00:07.840277 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m21:00:07.840277 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m21:00:07.840277 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m21:00:07.840277 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m21:00:07.841385 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m21:00:07.843400 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m21:00:07.844406 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m21:00:07.844406 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.844406 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.845406 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m21:00:07.845406 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m21:00:07.845911 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.846425 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m21:00:07.847101 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.848615 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.848615 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m21:00:07.850810 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m21:00:07.850810 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m21:00:07.851818 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m21:00:07.851818 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.853324 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m21:00:07.853324 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C3C9A30>]}
[0m21:00:07.854331 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.01s]
[0m21:00:07.854839 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m21:00:07.854839 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m21:00:07.855843 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m21:00:07.856356 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m21:00:07.856356 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m21:00:07.856356 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m21:00:07.858867 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m21:00:07.859872 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m21:00:07.859872 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.859872 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.860879 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m21:00:07.860879 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m21:00:07.861383 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.861888 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m21:00:07.862440 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.863953 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.864514 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m21:00:07.866025 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m21:00:07.866025 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m21:00:07.866619 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m21:00:07.866619 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.867709 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m21:00:07.868368 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C3E0AA0>]}
[0m21:00:07.868368 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.01s]
[0m21:00:07.868972 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m21:00:07.868972 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m21:00:07.870000 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m21:00:07.870517 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m21:00:07.870517 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m21:00:07.870517 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m21:00:07.874129 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m21:00:07.874129 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m21:00:07.874129 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.875749 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.875749 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m21:00:07.875749 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m21:00:07.876369 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.877374 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m21:00:07.877374 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m21:00:07.877998 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.879003 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m21:00:07.879881 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m21:00:07.880902 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m21:00:07.881211 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m21:00:07.882214 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.882214 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m21:00:07.882214 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C33CCE0>]}
[0m21:00:07.883219 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.01s]
[0m21:00:07.883219 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m21:00:07.884219 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m21:00:07.884219 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m21:00:07.884219 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m21:00:07.885221 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m21:00:07.894557 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m21:00:07.894557 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m21:00:07.906130 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m21:00:07.907251 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m21:00:07.907251 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m21:00:07.907251 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.908755 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.908755 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m21:00:07.908755 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:07.909762 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:07.912929 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m21:00:07.914491 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m21:00:07.914491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m21:00:07.915012 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.03s]
[0m21:00:07.915742 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m21:00:07.915742 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m21:00:07.915742 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m21:00:07.915742 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m21:00:07.917087 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m21:00:07.919159 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m21:00:07.920246 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m21:00:07.922735 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m21:00:07.923739 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m21:00:07.923739 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m21:00:07.923739 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.925173 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.925173 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m21:00:07.926214 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m21:00:07.926214 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.927683 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m21:00:07.928967 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m21:00:07.928967 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m21:00:07.929601 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m21:00:07.930607 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m21:00:07.931114 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m21:00:07.931114 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m21:00:07.931114 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m21:00:07.932140 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m21:00:07.936829 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m21:00:07.937829 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m21:00:07.939956 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m21:00:07.939956 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m21:00:07.940963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m21:00:07.940963 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.940963 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.942282 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m21:00:07.942282 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m21:00:07.944452 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:07.946655 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m21:00:07.947403 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m21:00:07.947403 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m21:00:07.948052 [info ] [Thread-1 (]: 24 of 97 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m21:00:07.948052 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m21:00:07.948052 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m21:00:07.949724 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m21:00:07.950266 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m21:00:07.950266 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m21:00:07.952797 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m21:00:07.953801 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m21:00:07.956368 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m21:00:07.957362 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m21:00:07.957362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m21:00:07.957362 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.958851 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.958851 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m21:00:07.959858 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m21:00:07.959858 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.961835 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m21:00:07.962426 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m21:00:07.962426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m21:00:07.962426 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m21:00:07.962426 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m21:00:07.962426 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m21:00:07.964495 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m21:00:07.964495 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m21:00:07.965500 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m21:00:07.971173 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m21:00:07.972169 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m21:00:07.973193 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m21:00:07.974191 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m21:00:07.975192 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m21:00:07.975192 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.975738 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.975738 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m21:00:07.975738 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:07.978386 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:07.979408 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m21:00:07.979408 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m21:00:07.981061 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m21:00:07.981061 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m21:00:07.982067 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m21:00:07.982067 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m21:00:07.982573 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m21:00:07.983577 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m21:00:07.983577 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m21:00:07.986596 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m21:00:07.987596 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m21:00:07.988100 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m21:00:07.989939 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m21:00:07.989939 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m21:00:07.991033 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:07.991033 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:07.991033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m21:00:07.991856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m21:00:07.993439 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:07.993945 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m21:00:07.994950 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m21:00:07.995954 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m21:00:07.996516 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.01s]
[0m21:00:07.996516 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m21:00:07.997212 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m21:00:07.997212 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m21:00:07.997790 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m21:00:07.998311 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m21:00:08.000925 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m21:00:08.001926 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m21:00:08.003456 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m21:00:08.003986 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m21:00:08.003986 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m21:00:08.003986 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.003986 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.005656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m21:00:08.005656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.006207 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.007211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m21:00:08.007211 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m21:00:08.007211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m21:00:08.008730 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m21:00:08.008730 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m21:00:08.008730 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m21:00:08.010481 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m21:00:08.010481 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m21:00:08.011052 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m21:00:08.013873 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m21:00:08.013873 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m21:00:08.015463 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m21:00:08.015463 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m21:00:08.017129 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m21:00:08.017129 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.017129 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.017129 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m21:00:08.018289 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m21:00:08.019975 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:08.021701 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m21:00:08.022212 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m21:00:08.022600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m21:00:08.023125 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m21:00:08.023649 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m21:00:08.023649 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m21:00:08.024225 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m21:00:08.024795 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m21:00:08.024795 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m21:00:08.029419 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m21:00:08.031149 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m21:00:08.033048 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m21:00:08.033646 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m21:00:08.034169 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m21:00:08.034169 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.034169 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.035175 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m21:00:08.035175 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.036007 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.036838 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m21:00:08.037944 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m21:00:08.038451 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m21:00:08.038451 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.01s]
[0m21:00:08.039935 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m21:00:08.039935 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m21:00:08.039935 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m21:00:08.040939 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m21:00:08.040939 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m21:00:08.043621 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m21:00:08.044629 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m21:00:08.046729 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m21:00:08.047453 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m21:00:08.048044 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m21:00:08.048044 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.048044 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.048044 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m21:00:08.048044 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.049667 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.050641 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m21:00:08.051756 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m21:00:08.051756 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m21:00:08.052762 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m21:00:08.052762 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m21:00:08.053809 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m21:00:08.053809 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m21:00:08.053809 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m21:00:08.053809 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m21:00:08.059021 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m21:00:08.060027 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m21:00:08.061232 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m21:00:08.062772 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m21:00:08.062772 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m21:00:08.063280 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.063793 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.063793 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m21:00:08.063793 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.066044 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:08.068212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m21:00:08.069226 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m21:00:08.069226 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m21:00:08.069729 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m21:00:08.069729 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m21:00:08.070732 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m21:00:08.070732 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m21:00:08.070732 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m21:00:08.070732 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m21:00:08.075257 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m21:00:08.076801 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m21:00:08.078312 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m21:00:08.078312 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m21:00:08.080168 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m21:00:08.080168 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.081005 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.081005 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m21:00:08.081005 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.086616 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m21:00:08.086616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m21:00:08.088579 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m21:00:08.088579 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m21:00:08.088579 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m21:00:08.090090 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m21:00:08.090090 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m21:00:08.090090 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m21:00:08.090090 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m21:00:08.091363 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m21:00:08.094004 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m21:00:08.095512 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m21:00:08.098103 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m21:00:08.098103 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m21:00:08.098103 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m21:00:08.098103 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.100156 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.100156 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m21:00:08.100156 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.100832 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.101829 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m21:00:08.102828 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m21:00:08.103358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m21:00:08.103358 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.01s]
[0m21:00:08.104207 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m21:00:08.104207 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m21:00:08.104207 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m21:00:08.104207 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m21:00:08.105783 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m21:00:08.107804 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m21:00:08.109335 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m21:00:08.110407 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m21:00:08.111940 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m21:00:08.111940 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m21:00:08.111940 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.112783 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.113290 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m21:00:08.113290 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.114082 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.114611 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m21:00:08.116146 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m21:00:08.116535 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m21:00:08.116535 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m21:00:08.117539 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m21:00:08.117992 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m21:00:08.118523 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m21:00:08.118523 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m21:00:08.119213 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m21:00:08.122452 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m21:00:08.123457 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m21:00:08.124977 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m21:00:08.124977 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m21:00:08.125988 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m21:00:08.125988 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.125988 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.126988 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m21:00:08.126988 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.128989 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:08.130494 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m21:00:08.132006 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m21:00:08.132006 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m21:00:08.133012 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m21:00:08.133283 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m21:00:08.133283 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m21:00:08.134362 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m21:00:08.134915 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m21:00:08.134915 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m21:00:08.138559 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m21:00:08.138559 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m21:00:08.141298 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m21:00:08.142297 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m21:00:08.142297 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m21:00:08.142993 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.142993 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.143691 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m21:00:08.143691 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.147817 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m21:00:08.148321 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m21:00:08.149956 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m21:00:08.149956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m21:00:08.149956 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m21:00:08.151096 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m21:00:08.151096 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m21:00:08.151096 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m21:00:08.152112 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m21:00:08.152616 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m21:00:08.155662 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m21:00:08.156692 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m21:00:08.157502 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m21:00:08.159422 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m21:00:08.159422 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m21:00:08.160015 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.160546 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.161055 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m21:00:08.161055 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.161781 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.163452 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m21:00:08.164027 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m21:00:08.164594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m21:00:08.164594 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m21:00:08.165598 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m21:00:08.165598 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m21:00:08.165598 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m21:00:08.166618 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m21:00:08.167173 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m21:00:08.171239 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m21:00:08.171239 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m21:00:08.173751 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m21:00:08.175060 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m21:00:08.175060 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m21:00:08.175060 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.176040 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.176040 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m21:00:08.176732 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.177295 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.178364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m21:00:08.178364 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m21:00:08.178364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m21:00:08.180144 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m21:00:08.180766 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m21:00:08.180766 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m21:00:08.181349 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m21:00:08.181349 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m21:00:08.181349 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m21:00:08.185057 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m21:00:08.186077 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m21:00:08.188632 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m21:00:08.189527 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m21:00:08.189527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m21:00:08.190563 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.191204 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.191204 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m21:00:08.191726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.193469 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:08.194000 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m21:00:08.195509 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m21:00:08.195509 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m21:00:08.196517 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m21:00:08.196517 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m21:00:08.197320 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m21:00:08.197320 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m21:00:08.198325 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m21:00:08.198325 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m21:00:08.201862 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m21:00:08.202862 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m21:00:08.204749 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m21:00:08.206254 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m21:00:08.206254 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m21:00:08.206254 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.207278 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.207278 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m21:00:08.207278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.212608 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m21:00:08.213617 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m21:00:08.213617 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m21:00:08.213617 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m21:00:08.215438 [info ] [Thread-1 (]: 41 of 97 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m21:00:08.215438 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m21:00:08.215438 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m21:00:08.215438 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m21:00:08.217222 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m21:00:08.217222 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m21:00:08.220506 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m21:00:08.221537 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m21:00:08.223816 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m21:00:08.224123 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m21:00:08.224123 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m21:00:08.224123 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.225629 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.225629 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m21:00:08.225629 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.227368 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.228883 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m21:00:08.229889 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m21:00:08.229889 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m21:00:08.229889 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m21:00:08.231037 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m21:00:08.231037 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m21:00:08.232178 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m21:00:08.232178 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m21:00:08.232178 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m21:00:08.235138 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m21:00:08.235903 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m21:00:08.237911 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m21:00:08.238513 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m21:00:08.239526 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m21:00:08.239526 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.240037 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.240338 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m21:00:08.241488 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.242397 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.243987 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m21:00:08.243987 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m21:00:08.243987 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m21:00:08.245498 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.01s]
[0m21:00:08.246028 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m21:00:08.246028 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m21:00:08.246028 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m21:00:08.247170 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m21:00:08.247170 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m21:00:08.251428 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m21:00:08.251428 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m21:00:08.252935 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m21:00:08.253985 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m21:00:08.253985 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m21:00:08.253985 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.253985 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.253985 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m21:00:08.255911 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.257773 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:08.258754 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m21:00:08.259361 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m21:00:08.259958 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m21:00:08.259958 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m21:00:08.261011 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m21:00:08.261011 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m21:00:08.261011 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m21:00:08.261011 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m21:00:08.262490 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m21:00:08.265876 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m21:00:08.266884 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m21:00:08.268990 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m21:00:08.269508 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m21:00:08.269508 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m21:00:08.269508 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.270525 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.270525 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m21:00:08.271447 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.275212 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m21:00:08.275212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m21:00:08.276897 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m21:00:08.276897 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m21:00:08.277619 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m21:00:08.278311 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m21:00:08.278636 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m21:00:08.278636 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m21:00:08.279792 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m21:00:08.279792 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m21:00:08.283233 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m21:00:08.283233 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m21:00:08.285837 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m21:00:08.285837 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m21:00:08.286892 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m21:00:08.286892 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.286892 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.287914 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m21:00:08.287914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.288941 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.290039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m21:00:08.290039 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m21:00:08.290798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m21:00:08.290798 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m21:00:08.290798 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m21:00:08.290798 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m21:00:08.292785 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m21:00:08.292785 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m21:00:08.293567 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m21:00:08.296268 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m21:00:08.297096 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m21:00:08.298160 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m21:00:08.300029 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m21:00:08.300029 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m21:00:08.300029 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.301138 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.301138 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m21:00:08.301138 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.302691 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.303402 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m21:00:08.304572 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m21:00:08.304572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m21:00:08.305184 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m21:00:08.305703 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m21:00:08.305703 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m21:00:08.305703 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m21:00:08.306805 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m21:00:08.306805 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m21:00:08.310973 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m21:00:08.311719 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m21:00:08.314978 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m21:00:08.315769 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m21:00:08.315769 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m21:00:08.315769 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.315769 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.316885 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m21:00:08.316885 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.320069 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m21:00:08.321151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m21:00:08.322262 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m21:00:08.322262 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m21:00:08.323369 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m21:00:08.323859 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m21:00:08.323859 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m21:00:08.323859 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m21:00:08.325060 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m21:00:08.325060 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m21:00:08.329085 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m21:00:08.330095 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m21:00:08.331941 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m21:00:08.332446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m21:00:08.332446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m21:00:08.332446 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.333453 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.333453 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m21:00:08.333453 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.339124 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m21:00:08.340240 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m21:00:08.341298 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m21:00:08.341298 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m21:00:08.341298 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m21:00:08.342426 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m21:00:08.342426 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m21:00:08.342426 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m21:00:08.343757 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m21:00:08.344763 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m21:00:08.347990 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m21:00:08.348603 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m21:00:08.350248 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m21:00:08.351358 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m21:00:08.351358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m21:00:08.351358 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.352812 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.352812 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m21:00:08.352812 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.353997 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.353997 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m21:00:08.353997 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m21:00:08.355814 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m21:00:08.355814 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m21:00:08.356835 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m21:00:08.356835 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m21:00:08.356835 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m21:00:08.358339 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m21:00:08.358339 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m21:00:08.361598 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m21:00:08.362130 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m21:00:08.364382 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m21:00:08.364895 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m21:00:08.364895 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m21:00:08.365902 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.365902 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.365902 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m21:00:08.366881 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.367456 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.368175 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m21:00:08.369182 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m21:00:08.369687 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m21:00:08.369687 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m21:00:08.369687 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m21:00:08.370744 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m21:00:08.370744 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m21:00:08.370744 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m21:00:08.370744 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m21:00:08.375260 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m21:00:08.375765 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m21:00:08.377271 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m21:00:08.378782 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m21:00:08.378782 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m21:00:08.378782 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.379870 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.379870 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m21:00:08.379870 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.381382 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.382493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m21:00:08.382493 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m21:00:08.383602 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m21:00:08.383602 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m21:00:08.383602 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m21:00:08.383602 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m21:00:08.385106 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m21:00:08.385884 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m21:00:08.385884 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m21:00:08.389835 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m21:00:08.390949 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m21:00:08.393293 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m21:00:08.393797 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m21:00:08.393797 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m21:00:08.394717 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.394717 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.395690 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m21:00:08.396196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.397942 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:08.397942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m21:00:08.399628 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m21:00:08.400372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m21:00:08.400372 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m21:00:08.401383 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m21:00:08.401383 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m21:00:08.401383 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m21:00:08.402886 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m21:00:08.402886 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m21:00:08.405473 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m21:00:08.406486 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m21:00:08.408502 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m21:00:08.409202 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m21:00:08.409733 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m21:00:08.409733 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.409733 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.410738 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m21:00:08.410738 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.411859 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.412880 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m21:00:08.412880 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m21:00:08.414056 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m21:00:08.414587 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m21:00:08.415094 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m21:00:08.415094 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m21:00:08.415803 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m21:00:08.415803 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m21:00:08.415803 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m21:00:08.419282 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m21:00:08.420310 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m21:00:08.422305 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m21:00:08.422839 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m21:00:08.422839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m21:00:08.423849 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.423849 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.423849 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m21:00:08.423849 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.425355 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.426376 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m21:00:08.427375 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m21:00:08.427884 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m21:00:08.427884 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m21:00:08.429408 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m21:00:08.429408 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m21:00:08.429408 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m21:00:08.429408 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m21:00:08.429408 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m21:00:08.433505 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m21:00:08.435051 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m21:00:08.436734 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m21:00:08.438242 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m21:00:08.438242 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m21:00:08.438242 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.438242 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.438242 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m21:00:08.439756 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.441266 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:08.442271 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m21:00:08.442917 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m21:00:08.443925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m21:00:08.443925 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m21:00:08.443925 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m21:00:08.445564 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m21:00:08.445564 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m21:00:08.446637 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m21:00:08.447142 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m21:00:08.450665 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m21:00:08.451665 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m21:00:08.454178 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m21:00:08.455249 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m21:00:08.455249 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m21:00:08.455249 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.456296 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.456296 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m21:00:08.456296 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.459927 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m21:00:08.461160 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m21:00:08.461693 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m21:00:08.461693 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m21:00:08.462803 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m21:00:08.463115 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m21:00:08.463619 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m21:00:08.463619 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m21:00:08.464625 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m21:00:08.464625 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m21:00:08.466959 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m21:00:08.468144 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m21:00:08.469680 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m21:00:08.470689 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m21:00:08.470689 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m21:00:08.470689 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.472197 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.472197 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m21:00:08.472197 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.473226 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.474206 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m21:00:08.475230 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m21:00:08.475767 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m21:00:08.475767 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m21:00:08.476761 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m21:00:08.477264 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m21:00:08.477264 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m21:00:08.477913 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m21:00:08.477913 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m21:00:08.480577 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m21:00:08.481221 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m21:00:08.482238 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m21:00:08.483692 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m21:00:08.483692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m21:00:08.484677 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.485204 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.485204 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m21:00:08.485782 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.485782 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.486788 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m21:00:08.488294 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m21:00:08.488294 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m21:00:08.488294 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m21:00:08.488294 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m21:00:08.490366 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m21:00:08.490366 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m21:00:08.490899 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m21:00:08.492182 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m21:00:08.495357 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m21:00:08.496551 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m21:00:08.498389 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m21:00:08.498389 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m21:00:08.500031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m21:00:08.500031 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.500552 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.500552 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m21:00:08.500552 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.503060 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m21:00:08.504586 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m21:00:08.505617 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m21:00:08.505617 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m21:00:08.506126 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m21:00:08.506722 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m21:00:08.506722 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m21:00:08.506722 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m21:00:08.508243 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m21:00:08.508243 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m21:00:08.511785 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m21:00:08.512382 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m21:00:08.514150 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m21:00:08.514731 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m21:00:08.514731 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m21:00:08.514731 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.515981 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.516354 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m21:00:08.516354 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:08.520739 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m21:00:08.521724 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m21:00:08.523215 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m21:00:08.523215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m21:00:08.523215 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m21:00:08.524221 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m21:00:08.524221 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m21:00:08.525221 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m21:00:08.525725 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m21:00:08.525725 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m21:00:08.528114 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m21:00:08.528114 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m21:00:08.532508 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m21:00:08.533205 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m21:00:08.533205 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m21:00:08.533205 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.534193 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.534193 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m21:00:08.535206 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m21:00:08.535532 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.538086 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m21:00:08.538086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m21:00:08.538086 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.538086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m21:00:08.539788 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m21:00:08.539788 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m21:00:08.543411 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m21:00:08.545569 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m21:00:08.546098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m21:00:08.546605 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.547268 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m21:00:08.547916 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AED0080>]}
[0m21:00:08.547916 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.02s]
[0m21:00:08.548662 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m21:00:08.548662 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m21:00:08.549667 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m21:00:08.549667 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m21:00:08.550308 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m21:00:08.553191 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m21:00:08.554200 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m21:00:08.555770 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m21:00:08.556865 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m21:00:08.556865 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m21:00:08.556865 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.556865 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.558371 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m21:00:08.558371 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m21:00:08.558371 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.560834 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m21:00:08.560834 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m21:00:08.562003 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.563177 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m21:00:08.563177 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m21:00:08.563704 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m21:00:08.564716 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.566843 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m21:00:08.566843 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m21:00:08.566843 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.568751 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m21:00:08.568751 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C3A9310>]}
[0m21:00:08.568751 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m21:00:08.570063 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m21:00:08.570063 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m21:00:08.570063 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m21:00:08.571080 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m21:00:08.571080 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m21:00:08.573729 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m21:00:08.573729 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m21:00:08.577631 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m21:00:08.578947 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m21:00:08.578947 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m21:00:08.578947 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:08.579501 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.579501 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m21:00:08.579501 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m21:00:08.580611 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.582266 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m21:00:08.582266 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m21:00:08.583580 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.583580 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m21:00:08.585074 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m21:00:08.585074 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m21:00:08.585756 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:08.587771 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m21:00:08.588276 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m21:00:08.588276 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:08.589978 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m21:00:08.589978 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AECEAB0>]}
[0m21:00:09.402890 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m21:00:09.409878 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.02s]
[0m21:00:09.410899 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m21:00:09.412926 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m21:00:09.413585 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m21:00:09.415132 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m21:00:09.415654 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m21:00:09.420576 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m21:00:09.423101 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m21:00:09.427734 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m21:00:09.428926 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m21:00:09.428926 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m21:00:09.429442 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.429442 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.429442 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m21:00:09.430466 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m21:00:09.431050 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.433230 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m21:00:09.433230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m21:00:09.434229 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.435230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m21:00:09.435230 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m21:00:09.435841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m21:00:09.435841 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.438581 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m21:00:09.439105 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m21:00:09.439643 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.439643 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m21:00:09.440664 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000023613EAAE40>]}
[0m21:00:09.441185 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m21:00:09.441185 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m21:00:09.441185 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m21:00:09.442266 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m21:00:09.442798 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m21:00:09.443317 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m21:00:09.445339 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m21:00:09.445339 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m21:00:09.447941 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m21:00:09.449562 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m21:00:09.449562 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m21:00:09.449968 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.449968 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.449968 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m21:00:09.451057 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m21:00:09.451057 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.454856 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m21:00:09.454856 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m21:00:09.455869 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.456403 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m21:00:09.456403 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m21:00:09.456403 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m21:00:09.457412 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.458396 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m21:00:09.460382 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m21:00:09.460919 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.461458 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m21:00:09.461458 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AFA30B0>]}
[0m21:00:09.462462 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.02s]
[0m21:00:09.462462 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m21:00:09.463670 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m21:00:09.463670 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m21:00:09.464676 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m21:00:09.464676 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m21:00:09.466779 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m21:00:09.468297 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m21:00:09.470516 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m21:00:09.470516 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m21:00:09.472027 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m21:00:09.472027 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.472027 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.472027 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m21:00:09.473033 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m21:00:09.473033 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.475050 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m21:00:09.476155 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m21:00:09.476155 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.477154 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m21:00:09.477154 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m21:00:09.477812 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m21:00:09.478359 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.479872 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m21:00:09.480877 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m21:00:09.480877 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.481885 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m21:00:09.482391 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361BE97F20>]}
[0m21:00:09.482391 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.02s]
[0m21:00:09.483270 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m21:00:09.483270 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m21:00:09.483270 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m21:00:09.484780 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m21:00:09.485358 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m21:00:09.487678 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m21:00:09.488724 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m21:00:09.491283 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m21:00:09.492287 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m21:00:09.492805 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m21:00:09.492805 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.493310 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.493310 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m21:00:09.493310 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m21:00:09.494317 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.496909 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m21:00:09.496909 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m21:00:09.497915 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.498420 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m21:00:09.498420 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m21:00:09.499426 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m21:00:09.499930 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.502998 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m21:00:09.502998 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m21:00:09.504186 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.505338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m21:00:09.505338 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AFCFB00>]}
[0m21:00:09.505338 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m21:00:09.507370 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m21:00:09.507370 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m21:00:09.508375 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m21:00:09.508375 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m21:00:09.508375 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m21:00:09.511326 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m21:00:09.511951 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m21:00:09.514723 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m21:00:09.515415 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m21:00:09.515415 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m21:00:09.515415 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.515415 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.515415 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m21:00:09.516976 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m21:00:09.517666 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.520258 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m21:00:09.520258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m21:00:09.520258 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.521258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m21:00:09.522258 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m21:00:09.522258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m21:00:09.522762 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.523769 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m21:00:09.525274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m21:00:09.525274 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.525274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m21:00:09.526850 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AFCF980>]}
[0m21:00:09.527378 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m21:00:09.527940 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m21:00:09.527940 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m21:00:09.527940 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m21:00:09.528944 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m21:00:09.528944 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m21:00:09.531959 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m21:00:09.533209 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m21:00:09.535232 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m21:00:09.535864 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m21:00:09.536878 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m21:00:09.536878 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.537877 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.537877 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m21:00:09.537877 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m21:00:09.538573 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.541089 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m21:00:09.541089 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m21:00:09.542096 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.542601 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m21:00:09.542601 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m21:00:09.542601 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m21:00:09.545031 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.546667 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m21:00:09.547254 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m21:00:09.547780 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.548407 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m21:00:09.548975 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AF33FB0>]}
[0m21:00:09.549524 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m21:00:09.550122 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m21:00:09.550122 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m21:00:09.550122 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m21:00:09.551127 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m21:00:09.551127 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m21:00:09.552632 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m21:00:09.554264 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m21:00:09.556824 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m21:00:09.558331 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m21:00:09.558331 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m21:00:09.558331 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.558331 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.558331 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m21:00:09.558331 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m21:00:09.559906 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.562015 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m21:00:09.562660 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m21:00:09.562660 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.564198 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m21:00:09.564198 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m21:00:09.564198 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m21:00:09.564198 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.567540 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m21:00:09.568179 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m21:00:09.568179 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.569194 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m21:00:09.570233 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363AEF4FB0>]}
[0m21:00:09.570233 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m21:00:09.571218 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m21:00:09.571218 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m21:00:09.571218 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m21:00:09.572233 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m21:00:09.572770 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m21:00:09.575302 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m21:00:09.576887 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m21:00:09.578219 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m21:00:09.579802 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m21:00:09.579802 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m21:00:09.580352 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.580885 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.580885 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m21:00:09.581423 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m21:00:09.581968 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.582982 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m21:00:09.584001 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m21:00:09.584001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m21:00:09.584996 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m21:00:09.585608 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m21:00:09.585608 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m21:00:09.585608 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m21:00:09.586620 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m21:00:09.586620 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m21:00:09.590852 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m21:00:09.591948 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m21:00:09.593522 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m21:00:09.594588 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m21:00:09.594588 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m21:00:09.594588 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.595565 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.595565 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m21:00:09.596070 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:09.597719 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.598263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m21:00:09.598263 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m21:00:09.598263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m21:00:09.599885 [info ] [Thread-1 (]: 73 of 97 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.01s]
[0m21:00:09.599885 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m21:00:09.600891 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m21:00:09.600891 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m21:00:09.601889 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m21:00:09.601889 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m21:00:09.604011 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m21:00:09.605606 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m21:00:09.606611 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m21:00:09.607640 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m21:00:09.607640 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m21:00:09.608611 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.608611 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.608611 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m21:00:09.608611 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m21:00:09.611168 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.611674 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m21:00:09.613186 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m21:00:09.613186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m21:00:09.613699 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.01s]
[0m21:00:09.613699 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m21:00:09.614705 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m21:00:09.614705 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m21:00:09.615209 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m21:00:09.615209 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m21:00:09.618967 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m21:00:09.620337 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m21:00:09.621364 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m21:00:09.622892 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m21:00:09.622892 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m21:00:09.622892 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.623904 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.623904 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m21:00:09.623904 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m21:00:09.623904 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.625410 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m21:00:09.626955 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m21:00:09.626955 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m21:00:09.627759 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m21:00:09.628330 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m21:00:09.628330 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m21:00:09.629335 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m21:00:09.629335 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m21:00:09.629335 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m21:00:09.633402 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m21:00:09.634908 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m21:00:09.636530 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m21:00:09.637510 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m21:00:09.637510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m21:00:09.637510 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.638878 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.638878 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m21:00:09.639404 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:09.639800 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.641828 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m21:00:09.642883 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m21:00:09.642883 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m21:00:09.643556 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m21:00:09.644121 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m21:00:09.644121 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m21:00:09.644121 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m21:00:09.645631 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m21:00:09.646172 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m21:00:09.648480 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m21:00:09.649988 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m21:00:09.650994 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m21:00:09.652514 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m21:00:09.652514 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m21:00:09.652514 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.652514 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.654104 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m21:00:09.654104 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m21:00:09.655641 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.656648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m21:00:09.657647 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m21:00:09.657647 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m21:00:09.657647 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m21:00:09.658750 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m21:00:09.658750 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m21:00:09.659756 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m21:00:09.659756 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m21:00:09.659756 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m21:00:09.662384 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m21:00:09.663980 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m21:00:09.665554 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m21:00:09.665554 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m21:00:09.665554 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m21:00:09.665554 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.667257 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.667887 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m21:00:09.667887 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m21:00:09.669041 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.670065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m21:00:09.671062 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m21:00:09.671062 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m21:00:09.671062 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m21:00:09.672046 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m21:00:09.672046 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m21:00:09.672046 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m21:00:09.673067 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m21:00:09.673067 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m21:00:09.676895 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m21:00:09.678407 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m21:00:09.680990 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m21:00:09.681997 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m21:00:09.682502 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m21:00:09.682502 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.682502 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.683508 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m21:00:09.683508 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:09.685014 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.685550 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m21:00:09.686556 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m21:00:09.686556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m21:00:09.687556 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m21:00:09.688122 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m21:00:09.688122 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m21:00:09.688122 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m21:00:09.688122 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m21:00:09.688122 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m21:00:09.692142 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m21:00:09.693275 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m21:00:09.693834 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m21:00:09.695370 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m21:00:09.695370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m21:00:09.695370 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.696381 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.696884 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m21:00:09.696884 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m21:00:09.697955 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:09.699519 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m21:00:09.700137 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m21:00:09.700137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m21:00:09.701151 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m21:00:09.701151 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m21:00:09.701151 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m21:00:09.701151 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m21:00:09.702656 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m21:00:09.702656 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m21:00:09.706588 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m21:00:09.707594 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m21:00:09.709603 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m21:00:09.710614 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m21:00:09.711121 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m21:00:09.711121 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:09.711776 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:09.711776 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m21:00:09.712344 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m21:00:16.477110 [debug] [Thread-1 (]: SQL status: OK in 6.764 seconds
[0m21:00:16.479523 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m21:00:16.480058 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m21:00:16.480058 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:16.481086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m21:00:16.481086 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m21:00:16.481086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m21:00:16.601289 [debug] [Thread-1 (]: SQL status: OK in 0.119 seconds
[0m21:00:16.602804 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m21:00:16.602804 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m21:00:16.602804 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:16.604511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m21:00:16.604511 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361A6ED5E0>]}
[0m21:00:16.605521 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 6.90s]
[0m21:00:16.605521 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m21:00:16.605521 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m21:00:16.607013 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m21:00:16.607013 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m21:00:16.608019 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m21:00:16.610458 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m21:00:16.611324 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m21:00:16.613465 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m21:00:16.614471 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m21:00:16.615083 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m21:00:16.615083 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:16.615618 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:16.615618 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m21:00:16.616142 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m21:00:16.754448 [debug] [Thread-1 (]: SQL status: OK in 0.138 seconds
[0m21:00:16.756970 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m21:00:16.756970 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m21:00:16.758759 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:16.759870 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m21:00:16.759870 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m21:00:16.759870 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m21:00:16.765898 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m21:00:16.767003 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m21:00:16.768229 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m21:00:16.768229 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:16.769337 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m21:00:16.769337 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000023613EAAE40>]}
[0m21:00:16.770442 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.16s]
[0m21:00:16.771420 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m21:00:16.771420 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m21:00:16.771420 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m21:00:16.772420 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m21:00:16.772924 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m21:00:16.775434 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m21:00:16.776441 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m21:00:16.779462 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m21:00:16.779462 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m21:00:16.779462 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m21:00:16.779462 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:16.781210 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:16.781210 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m21:00:16.781210 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m21:00:27.585154 [debug] [Thread-1 (]: SQL status: OK in 10.803 seconds
[0m21:00:27.587706 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m21:00:27.588230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m21:00:27.588230 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:27.588230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m21:00:27.588230 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m21:00:27.589921 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m21:00:27.623226 [debug] [Thread-1 (]: SQL status: OK in 0.033 seconds
[0m21:00:27.625241 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m21:00:27.625241 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m21:00:27.626367 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:27.626903 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m21:00:27.627554 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361C28C3B0>]}
[0m21:00:27.628209 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 10.86s]
[0m21:00:27.628740 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m21:00:27.628740 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m21:00:27.629746 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m21:00:27.629746 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m21:00:27.630849 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m21:00:27.633418 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m21:00:27.634418 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m21:00:27.636945 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m21:00:27.638419 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m21:00:27.638419 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m21:00:27.639078 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:27.639078 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:27.639593 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m21:00:27.639593 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m21:00:27.840887 [debug] [Thread-1 (]: SQL status: OK in 0.202 seconds
[0m21:00:27.844083 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m21:00:27.845071 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m21:00:27.845710 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:27.846480 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m21:00:27.846891 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m21:00:27.846891 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m21:00:27.857061 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m21:00:27.861240 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m21:00:27.861758 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m21:00:27.861758 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:27.863316 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m21:00:27.863316 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002363B387230>]}
[0m21:00:27.863837 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.23s]
[0m21:00:27.864849 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m21:00:27.864849 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m21:00:27.865353 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m21:00:27.865353 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m21:00:27.865353 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m21:00:27.869025 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m21:00:27.869826 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m21:00:27.872341 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m21:00:27.873348 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m21:00:27.873348 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m21:00:27.873348 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:27.874347 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:27.874347 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m21:00:27.874347 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m21:00:28.166933 [debug] [Thread-1 (]: SQL status: OK in 0.292 seconds
[0m21:00:28.169145 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m21:00:28.169798 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m21:00:28.169798 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.170472 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m21:00:28.171485 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m21:00:28.171485 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m21:00:28.210971 [debug] [Thread-1 (]: SQL status: OK in 0.039 seconds
[0m21:00:28.212778 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m21:00:28.213497 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m21:00:28.213497 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.214565 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m21:00:28.214565 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6661c3ac-ffae-49ee-be2f-fc550f47c242', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361BB0E270>]}
[0m21:00:28.215892 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.35s]
[0m21:00:28.215892 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m21:00:28.217192 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m21:00:28.217192 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m21:00:28.217823 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m21:00:28.218491 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m21:00:28.220549 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m21:00:28.222062 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m21:00:28.223070 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m21:00:28.224070 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m21:00:28.225069 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m21:00:28.225069 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.225574 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.225574 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m21:00:28.225574 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.225574 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.227080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m21:00:28.228592 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m21:00:28.228592 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m21:00:28.228592 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m21:00:28.229601 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m21:00:28.229601 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m21:00:28.229601 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m21:00:28.230607 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m21:00:28.230607 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m21:00:28.235573 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m21:00:28.236579 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m21:00:28.238133 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m21:00:28.239793 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m21:00:28.239793 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m21:00:28.239793 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.240801 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.240801 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m21:00:28.241426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.242705 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.243710 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m21:00:28.244809 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m21:00:28.244809 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m21:00:28.244809 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.01s]
[0m21:00:28.245807 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m21:00:28.246519 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m21:00:28.246519 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m21:00:28.247250 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m21:00:28.247880 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m21:00:28.251534 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m21:00:28.252537 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m21:00:28.254340 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m21:00:28.255373 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m21:00:28.255373 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m21:00:28.256523 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.256523 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.257529 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m21:00:28.257529 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m21:00:28.258525 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.260251 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m21:00:28.260863 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m21:00:28.260863 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m21:00:28.260863 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m21:00:28.262050 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m21:00:28.262579 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m21:00:28.262579 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m21:00:28.263590 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m21:00:28.263590 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m21:00:28.266815 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m21:00:28.267801 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m21:00:28.269307 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m21:00:28.269307 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m21:00:28.270379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m21:00:28.270379 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.270379 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.271382 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m21:00:28.271382 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.272381 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.273446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m21:00:28.273446 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m21:00:28.273446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m21:00:28.274969 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m21:00:28.275622 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m21:00:28.275622 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m21:00:28.275622 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m21:00:28.275622 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m21:00:28.277215 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m21:00:28.280429 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m21:00:28.281464 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m21:00:28.282525 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m21:00:28.284080 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m21:00:28.284080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m21:00:28.284080 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.285117 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.285117 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m21:00:28.285644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.285644 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.286480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m21:00:28.287671 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m21:00:28.287671 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m21:00:28.288672 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m21:00:28.288672 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m21:00:28.289845 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m21:00:28.289845 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m21:00:28.289845 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m21:00:28.290977 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m21:00:28.293552 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m21:00:28.294581 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m21:00:28.297084 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m21:00:28.298225 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m21:00:28.298225 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m21:00:28.298225 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.299253 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.299580 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m21:00:28.299580 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.300426 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.300961 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m21:00:28.301989 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m21:00:28.301989 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m21:00:28.302990 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.01s]
[0m21:00:28.302990 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m21:00:28.302990 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m21:00:28.304174 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m21:00:28.304174 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m21:00:28.304174 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m21:00:28.308447 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m21:00:28.308447 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m21:00:28.311656 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m21:00:28.313031 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m21:00:28.313031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m21:00:28.313031 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.314137 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.314137 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m21:00:28.314137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.315149 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.316452 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m21:00:28.317012 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m21:00:28.317012 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m21:00:28.317704 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.01s]
[0m21:00:28.318711 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m21:00:28.318711 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m21:00:28.318711 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m21:00:28.319710 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m21:00:28.319710 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m21:00:28.322710 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m21:00:28.323712 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m21:00:28.325710 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m21:00:28.326246 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m21:00:28.326246 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m21:00:28.327254 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.328188 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.328188 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m21:00:28.328694 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.329721 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.330329 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m21:00:28.331747 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m21:00:28.331747 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m21:00:28.331747 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.01s]
[0m21:00:28.332753 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m21:00:28.332753 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m21:00:28.332753 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m21:00:28.333802 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m21:00:28.333802 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m21:00:28.336775 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m21:00:28.337530 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m21:00:28.338894 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m21:00:28.340349 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m21:00:28.340853 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m21:00:28.340853 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.341783 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.341783 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m21:00:28.341783 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.343014 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.344149 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m21:00:28.344149 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m21:00:28.345664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m21:00:28.346478 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.01s]
[0m21:00:28.347076 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m21:00:28.347076 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m21:00:28.347076 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m21:00:28.347076 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m21:00:28.348091 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m21:00:28.351931 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m21:00:28.353032 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m21:00:28.354297 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m21:00:28.355213 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m21:00:28.355776 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m21:00:28.355776 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.355776 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.356781 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m21:00:28.356781 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.359626 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m21:00:28.360644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m21:00:28.361323 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m21:00:28.361323 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m21:00:28.362072 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.01s]
[0m21:00:28.362819 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m21:00:28.362819 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m21:00:28.362819 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m21:00:28.363944 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m21:00:28.363944 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m21:00:28.367961 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m21:00:28.368967 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m21:00:28.370819 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m21:00:28.371478 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m21:00:28.371478 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m21:00:28.371478 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.372478 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.372984 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m21:00:28.372984 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.373991 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.374991 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m21:00:28.377256 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m21:00:28.377256 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m21:00:28.377765 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.01s]
[0m21:00:28.378430 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m21:00:28.378430 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m21:00:28.378935 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m21:00:28.379447 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m21:00:28.379447 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m21:00:28.383556 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m21:00:28.384454 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m21:00:28.386452 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m21:00:28.387106 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m21:00:28.388113 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m21:00:28.388113 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m21:00:28.388618 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m21:00:28.388618 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m21:00:28.388618 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m21:00:28.390123 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m21:00:28.390991 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m21:00:28.391699 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m21:00:28.391699 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m21:00:28.392254 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m21:00:28.393069 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m21:00:28.394080 [debug] [MainThread]: Using duckdb connection "master"
[0m21:00:28.394080 [debug] [MainThread]: On master: BEGIN
[0m21:00:28.394080 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m21:00:28.395605 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m21:00:28.395605 [debug] [MainThread]: On master: COMMIT
[0m21:00:28.395605 [debug] [MainThread]: Using duckdb connection "master"
[0m21:00:28.395605 [debug] [MainThread]: On master: COMMIT
[0m21:00:28.396361 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m21:00:28.396361 [debug] [MainThread]: On master: Close
[0m21:00:28.396886 [debug] [MainThread]: Connection 'master' was properly closed.
[0m21:00:28.396886 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m21:00:28.396886 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m21:00:28.396886 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m21:00:28.397617 [info ] [MainThread]: 
[0m21:00:28.397617 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 28.24 seconds (28.24s).
[0m21:00:28.405590 [debug] [MainThread]: Command end result
[0m21:00:28.500649 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m21:00:28.503315 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m21:00:28.509754 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m21:00:28.509754 [info ] [MainThread]: 
[0m21:00:28.510938 [info ] [MainThread]: [32mCompleted successfully[0m
[0m21:00:28.510938 [info ] [MainThread]: 
[0m21:00:28.510938 [info ] [MainThread]: Done. PASS=97 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=97
[0m21:00:28.512650 [debug] [MainThread]: Command `dbt build` succeeded at 21:00:28.512650 after 32.82 seconds
[0m21:00:28.512650 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361A2A6240>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361A2A61B0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002361A214CE0>]}
[0m21:00:28.512650 [debug] [MainThread]: Flushing usage events
[0m21:00:29.234105 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:05:54.658335 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85C0A19A0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85F19F920>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85B7922A0>]}


============================== 06:05:54.664548 | d13bdf90-a459-4e70-a722-a9f708057ff3 ==============================
[0m06:05:54.664548 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:05:54.665050 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'invocation_command': 'dbt build', 'indirect_selection': 'eager', 'use_colors': 'True', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:05:54.863603 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85F6509E0>]}
[0m06:05:54.910690 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85EE6EEA0>]}
[0m06:05:54.913520 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:05:55.107158 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:05:55.705549 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 3 files changed.
[0m06:05:55.707576 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m06:05:55.709109 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_capital_prudencial.sql
[0m06:05:55.709109 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m06:05:55.710131 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m06:05:55.711821 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m06:05:55.711821 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m06:05:55.712862 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m06:05:55.713891 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m06:05:55.714970 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\dim_instituicao.sql
[0m06:05:55.716078 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://macros\utils.sql
[0m06:05:56.671236 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:05:56.673456 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860F6D310>]}
[0m06:05:57.115210 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:05:57.150143 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860F19C40>]}
[0m06:05:57.390975 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:05:57.435223 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:05:57.609010 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860C66810>]}
[0m06:05:57.610021 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:05:57.627177 [info ] [MainThread]: 
[0m06:05:57.628210 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:05:57.628210 [info ] [MainThread]: 
[0m06:05:57.631028 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:05:57.645386 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:06:01.832137 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:06:01.833159 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:06:01.834159 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:06:02.510243 [debug] [ThreadPool]: SQL status: OK in 0.676 seconds
[0m06:06:02.511863 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:06:02.513036 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:06:02.513541 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:06:02.523134 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:06:02.524124 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:06:02.524124 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:06:02.526257 [debug] [ThreadPool]: SQL status: OK in 0.002 seconds
[0m06:06:02.527856 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:06:02.528901 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:06:02.529869 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:06:02.529869 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:06:02.531309 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:06:02.532317 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:06:02.533509 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:06:02.535016 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:06:02.535016 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:06:02.536020 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:06:02.536020 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:06:02.540882 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:06:02.548136 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:06:02.549709 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:06:02.550358 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:06:02.551370 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:06:02.551370 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:06:02.551370 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:06:02.582179 [debug] [ThreadPool]: SQL status: OK in 0.030 seconds
[0m06:06:02.583510 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:06:02.586896 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:06:02.587423 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:06:02.588637 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8608FFF50>]}
[0m06:06:02.588637 [debug] [MainThread]: Using duckdb connection "master"
[0m06:06:02.589640 [debug] [MainThread]: On master: BEGIN
[0m06:06:02.589640 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:06:02.590713 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:06:02.590713 [debug] [MainThread]: On master: COMMIT
[0m06:06:02.592431 [debug] [MainThread]: Using duckdb connection "master"
[0m06:06:02.592431 [debug] [MainThread]: On master: COMMIT
[0m06:06:02.593465 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:06:02.593999 [debug] [MainThread]: On master: Close
[0m06:06:02.602009 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:06:02.603007 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:06:02.604155 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:06:02.604155 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:06:02.649577 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:06:02.654419 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:06:02.719655 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:06:02.722186 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:06:02.723198 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:06:02.724213 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:06:02.726417 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:02.726935 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:06:02.729526 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
FROM unificacao
    );
  
  
[0m06:06:02.740836 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
FROM unificacao
    );
  
  
[0m06:06:02.743649 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:06:02.744728 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: ROLLBACK
[0m06:06:02.765635 [debug] [Thread-1 (]: Failed to rollback 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:06:02.767187 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:06:02.773794 [debug] [Thread-1 (]: Runtime Error in model dim_instituicao (models\gold\dim_instituicao.sql)
  Parser Error: syntax error at or near "FROM"
[0m06:06:02.778247 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8613EE9C0>]}
[0m06:06:02.778247 [error] [Thread-1 (]: 1 of 97 ERROR creating sql table model main.dim_instituicao .................... [[31mERROR[0m in 0.17s]
[0m06:06:02.781404 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:06:02.781910 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:06:02.782916 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_instituicao' to be skipped because of status 'error'.  Reason: Runtime Error in model dim_instituicao (models\gold\dim_instituicao.sql)
  Parser Error: syntax error at or near "FROM".
[0m06:06:02.783930 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:06:02.786031 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:06:02.787624 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:06:02.796948 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:06:02.801208 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:06:02.807037 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:06:02.811238 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:06:02.812578 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:06:02.812578 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:02.814656 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:02.815685 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:06:02.815685 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:06:02.918471 [debug] [Thread-1 (]: SQL status: OK in 0.100 seconds
[0m06:06:02.928269 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:06:02.929843 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:06:02.932474 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:02.958382 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:06:02.960002 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:06:02.960002 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:06:02.967484 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:06:02.978285 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:06:02.978285 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:06:02.979960 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:02.985913 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:06:02.986567 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85C17DE80>]}
[0m06:06:02.988600 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.20s]
[0m06:06:02.991476 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:06:02.992491 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:06:02.994419 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:06:02.997074 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:06:02.998086 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:06:03.023407 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:06:03.027684 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:06:03.034116 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:06:03.038145 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:06:03.039466 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:06:03.040481 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:03.042001 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:03.042001 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:06:03.043684 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:06:03.192906 [debug] [Thread-1 (]: SQL status: OK in 0.148 seconds
[0m06:06:03.198002 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:06:03.199706 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:06:03.201403 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:03.202915 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:06:03.203933 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:06:03.203933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:06:03.207613 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:03.212011 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:06:03.212566 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:06:03.213579 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:03.215660 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:06:03.216922 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860AFB290>]}
[0m06:06:03.218449 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.22s]
[0m06:06:03.218955 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:06:03.219965 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:06:03.220969 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:06:03.223096 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:06:03.224092 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:06:03.241349 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:06:03.246457 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:06:03.261921 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:06:03.275044 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:06:03.279194 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:06:03.281933 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:03.284246 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:03.288572 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:06:03.294520 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || '')
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:06:05.413131 [debug] [Thread-1 (]: SQL status: OK in 2.112 seconds
[0m06:06:05.420266 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:06:05.420266 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:06:05.422263 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:05.425287 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:06:05.425287 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:06:05.427077 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:06:05.658332 [debug] [Thread-1 (]: SQL status: OK in 0.230 seconds
[0m06:06:05.663502 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:06:05.663502 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:06:05.665687 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:05.668075 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:06:05.669145 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860E7F950>]}
[0m06:06:05.670384 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 2.45s]
[0m06:06:05.672465 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:06:05.673476 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:06:05.675047 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:06:05.677059 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:06:05.677059 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:06:05.684962 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:06:05.688109 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:06:05.695626 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:06:05.698112 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:06:05.698112 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:06:05.698112 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:05.700428 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:05.700428 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:06:05.701439 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:06:06.125426 [debug] [Thread-1 (]: SQL status: OK in 0.424 seconds
[0m06:06:06.131895 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:06:06.132908 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:06:06.133904 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:06.137055 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:06:06.137055 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:06:06.138053 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:06:06.155371 [debug] [Thread-1 (]: SQL status: OK in 0.016 seconds
[0m06:06:06.160072 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:06:06.162137 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:06:06.162725 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:06.165541 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:06:06.166129 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8723395B0>]}
[0m06:06:06.167910 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.49s]
[0m06:06:06.167910 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:06:06.169676 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:06:06.170692 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:06:06.170692 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:06:06.172205 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:06:06.178406 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:06:06.182961 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:06:06.188228 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:06:06.192755 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:06:06.193292 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:06:06.193865 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:06.195429 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:06.196054 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:06:06.197306 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:06:06.336760 [debug] [Thread-1 (]: SQL status: OK in 0.139 seconds
[0m06:06:06.342783 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:06:06.343484 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:06:06.345637 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:06.348741 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:06:06.349795 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:06:06.350369 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:06:06.391847 [debug] [Thread-1 (]: SQL status: OK in 0.040 seconds
[0m06:06:06.396901 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:06:06.398023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:06:06.399655 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:06.402857 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:06:06.404376 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8608D9E50>]}
[0m06:06:06.407409 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.23s]
[0m06:06:06.411180 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:06:06.412283 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:06:06.413933 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:06:06.415023 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:06:06.415552 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:06:06.424397 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:06:06.427539 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:06:06.432314 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:06:06.435920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:06:06.436427 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:06:06.436937 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:06.437945 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:06.438626 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:06:06.439771 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:06:06.575168 [debug] [Thread-1 (]: SQL status: OK in 0.134 seconds
[0m06:06:06.584897 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:06:06.585565 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:06:06.587576 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:06.588520 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:06:06.590651 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:06:06.591278 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:06:06.760230 [debug] [Thread-1 (]: SQL status: OK in 0.169 seconds
[0m06:06:06.765338 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:06:06.766879 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:06:06.768063 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:06.770591 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:06:06.772100 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F872353E30>]}
[0m06:06:06.774121 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.36s]
[0m06:06:06.775279 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:06:06.777064 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:06:06.778730 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:06:06.779737 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:06:06.780289 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:06:06.789746 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:06:06.790758 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:06:06.797944 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:06:06.800251 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:06:06.800251 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:06:06.801276 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:06.802800 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:06.803813 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:06:06.805346 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:06:08.316098 [debug] [Thread-1 (]: SQL status: OK in 1.509 seconds
[0m06:06:08.322454 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:06:08.322991 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:06:08.324984 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:08.327179 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:06:08.327834 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:06:08.328371 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:06:08.611598 [debug] [Thread-1 (]: SQL status: OK in 0.282 seconds
[0m06:06:08.617906 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:06:08.617906 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:06:08.619630 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:08.622219 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:06:08.623765 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F872326510>]}
[0m06:06:08.623765 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 1.84s]
[0m06:06:08.627299 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:06:08.628082 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:06:08.628393 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:06:08.631437 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:06:08.632444 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:06:08.638563 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:06:08.640806 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:06:08.645716 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:06:08.647719 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:06:08.648241 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:06:08.648241 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:08.650428 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:08.651464 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:06:08.652971 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:06:08.663564 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:06:08.672187 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:06:08.673512 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:06:08.675034 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:08.677194 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:06:08.678682 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:06:08.678682 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:06:08.686894 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:06:08.694227 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:06:08.694227 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:06:08.697074 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:08.699634 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:06:08.700387 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F87231DE50>]}
[0m06:06:08.701401 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.07s]
[0m06:06:08.705528 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:06:08.706533 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:06:08.707549 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:06:08.707549 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:06:08.708533 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:06:08.720045 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:06:08.722084 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:06:08.728232 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:06:08.732042 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:06:08.734063 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:06:08.735060 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:08.735655 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:08.736660 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:06:08.736660 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar))
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:06:08.802999 [debug] [Thread-1 (]: SQL status: OK in 0.065 seconds
[0m06:06:08.808576 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:06:08.808576 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:06:08.810982 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:08.813840 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:06:08.815617 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:06:08.815617 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:06:08.829544 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m06:06:08.835361 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:06:08.835361 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:06:08.836596 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:08.840147 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:06:08.841072 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860C3DF40>]}
[0m06:06:08.841503 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.13s]
[0m06:06:08.843828 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:06:08.844704 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:06:08.846606 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:06:08.847127 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:06:08.849265 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:06:08.858965 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:06:08.862848 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:06:08.868471 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:06:08.870518 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:06:08.871506 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:06:08.872513 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:08.873072 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:08.874083 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:06:08.878148 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar))
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:06:09.605767 [debug] [Thread-1 (]: SQL status: OK in 0.724 seconds
[0m06:06:09.614170 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:06:09.614674 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:06:09.616181 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:09.617919 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:06:09.619432 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:06:09.620441 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:06:09.991348 [debug] [Thread-1 (]: SQL status: OK in 0.370 seconds
[0m06:06:10.001206 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:06:10.002872 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:06:10.004026 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.005828 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:06:10.007307 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F87238E630>]}
[0m06:06:10.008319 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 1.16s]
[0m06:06:10.010075 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:06:10.011604 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:06:10.013130 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:06:10.017844 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:06:10.018684 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:06:10.019393 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:06:10.076613 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:06:10.077122 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:06:10.078649 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.079679 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.080741 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:06:10.081304 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:06:10.082944 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.105944 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:06:10.106959 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.129640 [debug] [Thread-1 (]: SQL status: OK in 0.021 seconds
[0m06:06:10.144694 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:06:10.149367 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:06:10.150466 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:06:10.151571 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:06:10.155215 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.156733 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:06:10.157734 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860C6ABA0>]}
[0m06:06:10.157734 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.14s]
[0m06:06:10.160471 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:06:10.161513 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:06:10.162577 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:06:10.163585 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:06:10.163585 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:06:10.164824 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:06:10.173508 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:06:10.174511 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:06:10.174511 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.176015 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.176015 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:06:10.177046 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:06:10.178166 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.180834 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:06:10.181901 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.186143 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:06:10.187759 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:06:10.192582 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:06:10.199533 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:06:10.200161 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:06:10.212529 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.217282 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:06:10.218280 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8615A0650>]}
[0m06:06:10.219283 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.05s]
[0m06:06:10.222296 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:06:10.223621 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:06:10.225131 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:06:10.227137 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:06:10.227639 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:06:10.228199 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:06:10.235203 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:06:10.235725 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:06:10.237744 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.239053 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.240303 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:06:10.240892 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:06:10.240892 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.244663 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:06:10.245656 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.248210 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:06:10.250888 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:06:10.258476 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:06:10.258476 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:06:10.260198 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:06:10.262950 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.265770 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:06:10.267296 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85F796EA0>]}
[0m06:06:10.267598 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.04s]
[0m06:06:10.269224 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:06:10.269224 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:06:10.270235 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:06:10.272764 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:06:10.272764 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:06:10.273773 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:06:10.282289 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:06:10.282289 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:06:10.283440 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.284947 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.285472 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:06:10.286497 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:06:10.288023 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.290150 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:06:10.290655 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.294148 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:06:10.296444 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:06:10.300853 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:06:10.301861 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:06:10.303363 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:06:10.304790 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.306816 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:06:10.308325 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F861447470>]}
[0m06:06:10.308325 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.03s]
[0m06:06:10.311056 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:06:10.311586 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:06:10.312770 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:06:10.313791 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:06:10.313791 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:06:10.315363 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:06:10.325430 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:06:10.326605 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:06:10.327108 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.328445 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.328445 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:06:10.329966 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:06:10.332027 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.333161 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:06:10.334172 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.338585 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:06:10.341224 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:06:10.347473 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:06:10.348358 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:06:10.348890 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:06:10.352043 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.353118 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:06:10.355911 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F87231DE80>]}
[0m06:06:10.357396 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.04s]
[0m06:06:10.358397 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:06:10.358397 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:06:10.361413 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:06:10.364271 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:06:10.365413 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:06:10.365413 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:06:10.378161 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:06:10.378760 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:06:10.379782 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.380837 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.380837 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:06:10.383579 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:06:10.385112 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.386862 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:06:10.388352 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.394311 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:06:10.394311 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:06:10.400948 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:06:10.402050 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:06:10.403133 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:06:10.405365 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.406667 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:06:10.407717 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F87232B2C0>]}
[0m06:06:10.410289 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.04s]
[0m06:06:10.414220 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:06:10.414220 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:06:10.416059 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:06:10.419757 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:06:10.420759 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:06:10.421773 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:06:10.536118 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:06:10.536767 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:06:10.538489 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.540546 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.541067 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:06:10.541067 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:06:10.544311 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.547014 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:06:10.547533 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.554150 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:06:10.554150 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:06:10.561642 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:06:10.562649 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:06:10.563794 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:06:10.567587 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.579783 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:06:10.582437 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F872376D20>]}
[0m06:06:10.586603 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.16s]
[0m06:06:10.592463 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:06:10.595506 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:06:10.598685 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:06:10.599892 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:06:10.601540 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:06:10.604121 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:06:10.624390 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:06:10.628187 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:06:10.629920 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.632440 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.634963 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:06:10.636482 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:06:10.638633 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.642287 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:06:10.643497 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.651135 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:06:10.652649 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:06:10.658530 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:06:10.662999 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:06:10.664111 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:06:10.665646 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.667306 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:06:10.668164 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85C27A030>]}
[0m06:06:10.669895 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.07s]
[0m06:06:10.670968 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:06:10.670968 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:06:10.671945 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:06:10.673354 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:06:10.673354 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:06:10.674354 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:06:10.680861 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:06:10.680861 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:06:10.681928 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.682562 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.683574 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:06:10.683574 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:06:10.685735 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.687741 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:06:10.688365 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.692305 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:06:10.693760 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:06:10.697883 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:06:10.698458 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:06:10.699488 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:06:10.701044 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.703023 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:06:10.704246 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860FB4BF0>]}
[0m06:06:10.705918 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.03s]
[0m06:06:10.706943 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:06:10.706943 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:06:10.708453 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:06:10.711410 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:06:10.712439 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:06:10.712439 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:06:10.720275 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:06:10.720275 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:06:10.721260 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.722770 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.722770 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:06:10.723824 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:06:10.725331 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.727502 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:06:10.728091 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:06:10.731243 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.732273 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:06:10.736342 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:06:10.736342 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:06:10.737360 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:06:10.740138 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.741350 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:06:10.742486 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85E791B20>]}
[0m06:06:10.744028 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.03s]
[0m06:06:10.745535 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:06:10.746728 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:06:10.747899 [info ] [Thread-1 (]: 22 of 97 SKIP test not_null_dim_instituicao_id_instituicao ..................... [[33mSKIP[0m]
[0m06:06:10.748521 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:06:10.749549 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:06:10.750071 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed' to be skipped because of status 'skipped'. 
[0m06:06:10.750071 [info ] [Thread-1 (]: 23 of 97 SKIP test not_null_dim_instituicao_id_localizacao ..................... [[33mSKIP[0m]
[0m06:06:10.752628 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:06:10.752628 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:06:10.754413 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957' to be skipped because of status 'skipped'. 
[0m06:06:10.754413 [info ] [Thread-1 (]: 24 of 97 SKIP test unique_dim_instituicao_id_instituicao ....................... [[33mSKIP[0m]
[0m06:06:10.755444 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:06:10.756634 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:06:10.760843 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37' to be skipped because of status 'skipped'. 
[0m06:06:10.760253 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:06:10.761857 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:06:10.761857 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:06:10.786054 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:06:10.789855 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:06:10.827530 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:06:10.830546 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:06:10.831050 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:06:10.832073 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.833181 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.834164 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:06:10.835180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:06:10.836821 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.844717 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:06:10.847094 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:06:10.848116 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:06:10.849639 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.09s]
[0m06:06:10.851273 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:06:10.851273 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:06:10.853044 [info ] [Thread-1 (]: 26 of 97 SKIP test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[33mSKIP[0m]
[0m06:06:10.854559 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:06:10.855587 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:06:10.856618 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42' to be skipped because of status 'skipped'. 
[0m06:06:10.856618 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:06:10.858617 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:06:10.860363 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:06:10.875337 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:06:10.878120 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:06:10.881929 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:06:10.885457 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:06:10.885963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:06:10.887509 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.888724 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.889737 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:06:10.889737 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:06:10.895596 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:06:10.897978 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:06:10.901466 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:06:10.901466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:06:10.903983 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.04s]
[0m06:06:10.906663 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:06:10.906663 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:06:10.908183 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:06:10.910936 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:06:10.911943 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:06:10.919585 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:06:10.923267 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:06:10.928498 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:06:10.932240 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:06:10.932821 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:06:10.933835 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.934369 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.935744 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:06:10.935744 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:10.937909 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:10.941429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:06:10.944106 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:06:10.944106 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:06:10.946192 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.03s]
[0m06:06:10.947940 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:06:10.949569 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:06:10.950324 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:06:10.951348 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:06:10.952852 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:06:10.960246 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:06:10.962855 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:06:10.967956 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:06:10.972699 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:06:10.973709 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:06:10.975216 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:10.977242 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:10.978437 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:06:10.979466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:06:10.983421 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:06:10.988090 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:06:10.991151 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:06:10.991151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:06:10.993507 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.04s]
[0m06:06:10.995040 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:06:10.996246 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:06:10.997338 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:06:10.998536 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:06:11.000058 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:06:11.007134 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:06:11.008656 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:06:11.015014 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:06:11.017706 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:06:11.018451 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:06:11.019482 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.020016 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.022091 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:06:11.023118 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.025119 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.028142 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:06:11.029851 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:06:11.031362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:06:11.033236 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.03s]
[0m06:06:11.034218 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:06:11.035542 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:06:11.036045 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:06:11.036045 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:06:11.038197 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:06:11.046144 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:06:11.047996 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:06:11.053349 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:06:11.055487 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:06:11.056709 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:06:11.058684 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.060229 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.061111 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:06:11.062043 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.064814 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.067941 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:06:11.070251 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:06:11.071253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:06:11.072758 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.04s]
[0m06:06:11.074468 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:06:11.075466 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:06:11.075466 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:06:11.077138 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:06:11.078657 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:06:11.090705 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:06:11.092650 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:06:11.098126 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:06:11.102444 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:06:11.102953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:06:11.104521 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.106049 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.106749 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:06:11.107753 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.118166 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:06:11.121401 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:06:11.123957 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:06:11.125465 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:06:11.127058 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.05s]
[0m06:06:11.128000 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:06:11.129652 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:06:11.131292 [info ] [Thread-1 (]: 33 of 97 SKIP test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:06:11.132323 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:06:11.133495 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:06:11.135022 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01' to be skipped because of status 'skipped'. 
[0m06:06:11.133495 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:06:11.136052 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:06:11.138305 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:06:11.145448 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:06:11.149628 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:06:11.154513 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:06:11.157658 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:06:11.159037 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:06:11.160102 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.161931 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.162900 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:06:11.162900 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.165562 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.168721 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:06:11.171251 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:06:11.172792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:06:11.173788 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.04s]
[0m06:06:11.176921 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:06:11.177561 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:06:11.178125 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:06:11.181927 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:06:11.182966 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:06:11.189764 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:06:11.190817 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:06:11.195398 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:06:11.198574 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:06:11.199584 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:06:11.200391 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.202931 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.202931 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:06:11.203952 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.205562 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.208588 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:06:11.211282 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:06:11.211671 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:06:11.212799 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.03s]
[0m06:06:11.214836 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:06:11.215841 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:06:11.215841 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:06:11.221039 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:06:11.222030 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:06:11.232603 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:06:11.233613 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:06:11.240791 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:06:11.244214 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:06:11.244214 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:06:11.245758 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.247209 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.248092 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:06:11.248092 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.257905 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:06:11.261465 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:06:11.263539 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:06:11.264398 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:06:11.265717 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.04s]
[0m06:06:11.267908 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:06:11.268931 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:06:11.269942 [info ] [Thread-1 (]: 37 of 97 SKIP test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:06:11.271467 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:06:11.271974 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:06:11.274007 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c' to be skipped because of status 'skipped'. 
[0m06:06:11.274007 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:06:11.275517 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:06:11.277077 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:06:11.286358 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:06:11.288465 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:06:11.297380 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:06:11.299596 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:06:11.300101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:06:11.300101 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.301618 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.303148 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:06:11.303148 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.304714 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.308282 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:06:11.309917 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:06:11.310942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:06:11.312681 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.04s]
[0m06:06:11.313758 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:06:11.315280 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:06:11.315951 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:06:11.316984 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:06:11.318012 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:06:11.327140 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:06:11.329568 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:06:11.333715 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:06:11.336974 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:06:11.336974 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:06:11.337990 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.338511 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.340219 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:06:11.340925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.343419 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.346159 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:06:11.348181 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:06:11.348486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:06:11.350003 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.03s]
[0m06:06:11.350815 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:06:11.351850 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:06:11.351850 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:06:11.353356 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:06:11.354251 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:06:11.365101 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:06:11.367635 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:06:11.372196 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:06:11.376033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:06:11.377055 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:06:11.378240 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.379911 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.379911 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:06:11.381552 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.387817 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:06:11.391493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:06:11.393557 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:06:11.394566 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:06:11.396302 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.04s]
[0m06:06:11.398032 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:06:11.399809 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:06:11.400820 [info ] [Thread-1 (]: 41 of 97 SKIP test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:06:11.403354 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:06:11.403924 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:06:11.403924 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29' to be skipped because of status 'skipped'. 
[0m06:06:11.406364 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:06:11.408387 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:06:11.408387 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:06:11.417505 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:06:11.420358 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:06:11.424232 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:06:11.425743 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:06:11.428101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:06:11.428503 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.428503 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.430013 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:06:11.430013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.431575 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.433784 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:06:11.436412 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:06:11.436412 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:06:11.438370 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.03s]
[0m06:06:11.440899 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:06:11.441526 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:06:11.443050 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:06:11.444782 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:06:11.445780 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:06:11.454488 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:06:11.458688 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:06:11.462870 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:06:11.465328 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:06:11.465328 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:06:11.467521 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.469612 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.470304 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:06:11.471333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.473878 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.476950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:06:11.478377 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:06:11.479904 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:06:11.481628 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.04s]
[0m06:06:11.484918 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:06:11.485250 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:06:11.485752 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:06:11.487755 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:06:11.488617 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:06:11.501249 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:06:11.504739 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:06:11.512731 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:06:11.516746 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:06:11.517400 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:06:11.518846 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.521299 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.522401 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:06:11.523042 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.530765 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:06:11.533371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:06:11.536776 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:06:11.537788 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:06:11.538311 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.05s]
[0m06:06:11.540098 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:06:11.540098 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:06:11.541647 [info ] [Thread-1 (]: 45 of 97 SKIP test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:06:11.542792 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:06:11.542792 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:06:11.543812 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33' to be skipped because of status 'skipped'. 
[0m06:06:11.544138 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:06:11.545576 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:06:11.546186 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:06:11.551599 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:06:11.554564 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:06:11.559004 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:06:11.561509 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:06:11.562028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:06:11.562708 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.563728 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.564237 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:06:11.565187 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.567201 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.569364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:06:11.571391 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:06:11.571391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:06:11.572392 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.03s]
[0m06:06:11.573629 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:06:11.575148 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:06:11.575148 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:06:11.576176 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:06:11.576176 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:06:11.584140 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:06:11.585662 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:06:11.590015 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:06:11.593490 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:06:11.593490 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:06:11.594513 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.596041 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.596895 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:06:11.597413 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.599623 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.601431 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:06:11.603960 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:06:11.603960 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:06:11.605734 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.03s]
[0m06:06:11.606479 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:06:11.607601 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:06:11.609224 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:06:11.610247 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:06:11.611253 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:06:11.621401 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:06:11.625543 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:06:11.630845 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:06:11.633853 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:06:11.634990 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:06:11.635587 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.638170 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.638170 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:06:11.639946 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.647950 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:06:11.651381 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:06:11.654068 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:06:11.654572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:06:11.655576 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.05s]
[0m06:06:11.656581 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:06:11.657681 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:06:11.659197 [info ] [Thread-1 (]: 49 of 97 SKIP test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:06:11.659809 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:06:11.660814 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:06:11.661887 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71' to be skipped because of status 'skipped'. 
[0m06:06:11.660814 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:06:11.661887 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:06:11.662962 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:06:11.670881 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:06:11.673091 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:06:11.679919 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:06:11.682414 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:06:11.683427 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:06:11.684937 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.686593 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.687597 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:06:11.688165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.689838 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.690891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:06:11.693508 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:06:11.694561 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:06:11.696130 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.03s]
[0m06:06:11.698477 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:06:11.698477 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:06:11.699990 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:06:11.703053 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:06:11.704151 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:06:11.711108 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:06:11.714183 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:06:11.719254 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:06:11.722786 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:06:11.723302 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:06:11.724325 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.725925 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.726977 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:06:11.727780 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.732275 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.735652 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:06:11.738295 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:06:11.738615 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:06:11.740180 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.04s]
[0m06:06:11.742546 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:06:11.744178 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:06:11.744178 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:06:11.746909 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:06:11.747476 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:06:11.758734 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:06:11.763661 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:06:11.768322 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:06:11.775185 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:06:11.776197 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:06:11.777297 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.779028 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.781419 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:06:11.782405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.788996 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:06:11.791592 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:06:11.793872 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:06:11.795619 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:06:11.796924 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.05s]
[0m06:06:11.800064 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:06:11.801189 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:06:11.801189 [info ] [Thread-1 (]: 53 of 97 SKIP test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:06:11.804300 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:06:11.805422 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:06:11.806686 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59' to be skipped because of status 'skipped'. 
[0m06:06:11.806686 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:06:11.809425 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:06:11.810860 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:06:11.819403 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:06:11.821183 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:06:11.826070 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:06:11.828761 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:06:11.828761 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:06:11.830783 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.831694 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:11.832676 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:06:11.832676 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.834383 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.837734 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:06:11.839017 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:06:11.840682 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:06:11.841313 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.03s]
[0m06:06:11.842443 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:06:11.843749 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:06:11.844155 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:06:11.845018 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:06:11.846016 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:06:11.854246 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:06:11.861116 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:06:11.865058 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:06:11.868340 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:06:11.868950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:06:11.869981 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.870966 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.873485 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:06:11.874495 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.875595 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.879605 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:06:11.881877 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:06:11.882998 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:06:11.883604 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.04s]
[0m06:06:11.886126 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:06:11.887649 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:06:11.889826 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:06:11.890834 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:06:11.892495 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:06:11.903657 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:06:11.906746 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:06:11.915156 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:06:11.918095 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:06:11.919479 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:06:11.919479 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.920602 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.922230 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:06:11.922230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.928857 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:06:11.932240 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:06:11.935264 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:06:11.936039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:06:11.937208 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.05s]
[0m06:06:11.939642 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:06:11.940675 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:06:11.941309 [info ] [Thread-1 (]: 57 of 97 SKIP test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:06:11.943448 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:06:11.945041 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:06:11.946137 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871' to be skipped because of status 'skipped'. 
[0m06:06:11.946734 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:06:11.947948 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:06:11.950290 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:06:11.957514 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:06:11.962590 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:06:11.967514 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:06:11.970380 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:06:11.970890 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:06:11.970890 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:11.972192 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.973218 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:06:11.973218 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:06:11.975200 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:11.978712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:06:11.981048 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:06:11.982207 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:06:11.983594 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.03s]
[0m06:06:11.985923 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:06:11.987048 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:06:11.987991 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:06:11.989678 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:06:11.991031 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:06:11.999128 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:06:12.002855 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:06:12.006931 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:06:12.009440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:06:12.009951 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:06:12.012358 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:12.012661 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.013667 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:06:12.014801 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:06:12.017080 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.020112 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:06:12.022175 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:06:12.023201 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:06:12.025188 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.03s]
[0m06:06:12.027209 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:06:12.028215 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:06:12.028723 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:06:12.030742 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:06:12.031367 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:06:12.042073 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:06:12.043579 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:06:12.050252 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:06:12.054129 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:06:12.055807 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:06:12.056834 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:12.058835 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:12.060031 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:06:12.060031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:06:12.069816 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:06:12.073362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:06:12.075862 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:06:12.077370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:06:12.078595 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.05s]
[0m06:06:12.080656 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:06:12.081285 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:06:12.082308 [info ] [Thread-1 (]: 61 of 97 SKIP test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:06:12.083669 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:06:12.083669 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:06:12.085191 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a' to be skipped because of status 'skipped'. 
[0m06:06:12.085852 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:06:12.086880 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:06:12.087880 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:06:12.093682 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:06:12.096232 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:06:12.103897 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:06:12.106505 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:06:12.107492 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:06:12.108493 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:12.108493 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.110279 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:06:12.111758 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:06:12.113782 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.124241 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:06:12.125240 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:06:12.127073 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.130173 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:06:12.130694 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:06:12.131832 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:06:12.133362 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.136593 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:06:12.138323 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:06:12.139156 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:12.141221 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:06:12.142965 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860F93E60>]}
[0m06:06:12.143686 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.06s]
[0m06:06:12.145690 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:06:12.146192 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:06:12.146192 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:06:12.148005 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:06:12.148508 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:06:12.153590 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:06:12.155846 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:06:12.162762 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:06:12.164888 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:06:12.165223 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:06:12.165753 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:12.167306 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:12.168043 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:06:12.168043 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:06:12.170200 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.177290 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:06:12.178534 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:06:12.179561 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.182008 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:06:12.183035 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:06:12.184019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:06:12.185742 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:12.189939 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:06:12.190979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:06:12.192192 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:12.194615 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:06:12.195615 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8723337A0>]}
[0m06:06:13.074156 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:06:13.077449 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.05s]
[0m06:06:13.079494 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:06:13.081178 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:06:13.082207 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:06:13.084832 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:06:13.086133 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:06:13.092618 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:06:13.095907 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:06:13.103043 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:06:13.106840 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:06:13.107410 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:06:13.108434 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.108434 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.110076 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:06:13.110401 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:06:13.112465 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.118115 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:06:13.118647 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:06:13.120171 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.122704 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:06:13.123715 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:06:13.123715 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:06:13.127329 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.135957 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:06:13.136985 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:06:13.138491 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.141050 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:06:13.142600 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8615D5E50>]}
[0m06:06:13.144160 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.06s]
[0m06:06:13.146272 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:06:13.147002 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:06:13.148548 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:06:13.150099 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:06:13.151112 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:06:13.157045 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:06:13.160829 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:06:13.167995 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:06:13.170531 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:06:13.172051 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:06:13.173080 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.174078 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.175571 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:06:13.175571 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:06:13.178652 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.186930 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:06:13.189448 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:06:13.191102 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.193271 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:06:13.194303 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:06:13.195300 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:06:13.198190 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.202561 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:06:13.202561 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:06:13.205256 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.207371 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:06:13.208901 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F872331970>]}
[0m06:06:13.209924 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.06s]
[0m06:06:13.213126 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:06:13.213681 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:06:13.215705 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:06:13.216958 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:06:13.217969 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:06:13.224191 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:06:13.225721 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:06:13.233940 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:06:13.236730 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:06:13.237746 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:06:13.238403 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.238403 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.240167 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:06:13.240796 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:06:13.243122 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.248401 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:06:13.249952 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:06:13.251503 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.254156 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:06:13.254509 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:06:13.255489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:06:13.258649 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.263611 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:06:13.264650 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:06:13.265917 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.271246 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:06:13.272744 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F872399AF0>]}
[0m06:06:13.273761 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.06s]
[0m06:06:13.277126 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:06:13.277126 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:06:13.278642 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:06:13.280091 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:06:13.280785 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:06:13.286866 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:06:13.288273 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:06:13.296044 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:06:13.298533 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:06:13.300186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:06:13.300186 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.302729 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.302729 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:06:13.304356 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:06:13.306913 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.312789 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:06:13.313852 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:06:13.315571 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.318398 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:06:13.319082 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:06:13.320095 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:06:13.322391 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.325458 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:06:13.327021 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:06:13.328252 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.330858 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:06:13.331391 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F872392420>]}
[0m06:06:13.333428 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.05s]
[0m06:06:13.334948 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:06:13.336504 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:06:13.338065 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:06:13.339759 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:06:13.341316 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:06:13.347096 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:06:13.349683 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:06:13.355763 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:06:13.358291 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:06:13.359887 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:06:13.360909 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.362644 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.364193 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:06:13.364714 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:06:13.367763 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.374120 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:06:13.375106 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:06:13.375616 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.378393 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:06:13.379422 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:06:13.379422 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:06:13.383677 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.388442 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:06:13.390123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:06:13.390738 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.393890 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:06:13.396443 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860F7CC80>]}
[0m06:06:13.397995 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.06s]
[0m06:06:13.399531 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:06:13.400842 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:06:13.402869 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:06:13.403922 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:06:13.405529 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:06:13.411624 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:06:13.415362 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:06:13.426101 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:06:13.428204 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:06:13.428204 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:06:13.430593 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.432279 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.433307 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:06:13.433307 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:06:13.436458 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.442598 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:06:13.442598 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:06:13.445707 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.447917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:06:13.448442 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:06:13.449987 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:06:13.452002 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.457146 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:06:13.458667 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:06:13.459681 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.463875 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:06:13.464926 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8723D3110>]}
[0m06:06:13.465451 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.06s]
[0m06:06:13.468427 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:06:13.469112 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:06:13.471140 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:06:13.473213 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:06:13.473213 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:06:13.481339 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:06:13.484017 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:06:13.489762 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:06:13.492344 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:06:13.493297 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:06:13.493827 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.496366 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.496875 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:06:13.498115 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:06:13.500252 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.506667 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:06:13.508190 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:06:13.510965 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.513758 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:06:13.514814 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:06:13.515386 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:06:13.517950 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.522110 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:06:13.523217 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:06:13.525131 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.527873 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:06:13.527873 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860C6B6E0>]}
[0m06:06:13.530538 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.06s]
[0m06:06:13.531106 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:06:13.532114 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:06:13.533552 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:06:13.533552 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:06:13.535062 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:06:13.540039 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:06:13.543535 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:06:13.551209 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:06:13.557008 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:06:13.558542 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:06:13.560261 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.561985 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.562646 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:06:13.563661 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:06:13.565911 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.572743 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:06:13.572743 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:06:13.575262 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.577680 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:06:13.578322 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:06:13.578322 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:06:13.582492 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.587619 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:06:13.588152 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:06:13.589759 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.590772 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:06:13.592592 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8723B7440>]}
[0m06:06:13.594116 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.06s]
[0m06:06:13.596905 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:06:13.597919 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:06:13.598518 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:06:13.600949 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:06:13.603005 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:06:13.611770 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:06:13.615018 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:06:13.619972 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:06:13.622506 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:06:13.623512 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:06:13.623512 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.626053 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.627068 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:06:13.627598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:06:13.629909 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.633042 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:06:13.635692 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:06:13.635692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:06:13.637714 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.04s]
[0m06:06:13.639858 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:06:13.640881 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:06:13.640881 [info ] [Thread-1 (]: 73 of 97 SKIP test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[33mSKIP[0m]
[0m06:06:13.642588 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:06:13.643616 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:06:13.643616 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0' to be skipped because of status 'skipped'. 
[0m06:06:13.644713 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:06:13.646263 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:06:13.647918 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:06:13.655791 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:06:13.658322 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:06:13.662516 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:06:13.665473 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:06:13.665473 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:06:13.665473 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.667814 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.668927 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:06:13.669956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:06:13.673468 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.675691 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:06:13.678316 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:06:13.679320 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:06:13.679320 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.03s]
[0m06:06:13.680997 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:06:13.682014 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:06:13.683062 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:06:13.683062 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:06:13.684061 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:06:13.689659 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:06:13.691821 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:06:13.694407 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:06:13.700126 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:06:13.701154 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:06:13.702665 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.705244 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.706383 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:06:13.707383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:06:13.708368 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.712508 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:06:13.715266 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:06:13.715815 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:06:13.717502 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.03s]
[0m06:06:13.719069 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:06:13.721051 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:06:13.721051 [info ] [Thread-1 (]: 76 of 97 SKIP test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[33mSKIP[0m]
[0m06:06:13.722584 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:06:13.723597 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:06:13.723597 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e' to be skipped because of status 'skipped'. 
[0m06:06:13.725117 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:06:13.727131 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:06:13.728157 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:06:13.736835 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:06:13.738657 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:06:13.748128 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:06:13.751401 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:06:13.751401 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:06:13.752924 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.753950 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.753950 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:06:13.755639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:06:13.758821 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.761047 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:06:13.763698 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:06:13.763698 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:06:13.765837 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.04s]
[0m06:06:13.767360 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:06:13.767901 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:06:13.768935 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:06:13.769439 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:06:13.770446 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:06:13.777374 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:06:13.780347 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:06:13.784982 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:06:13.787640 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:06:13.788148 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:06:13.789056 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.789056 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.790579 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:06:13.791214 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:06:13.792241 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.794525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:06:13.796743 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:06:13.797439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:06:13.798603 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.03s]
[0m06:06:13.800117 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:06:13.800117 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:06:13.801141 [info ] [Thread-1 (]: 79 of 97 SKIP test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[33mSKIP[0m]
[0m06:06:13.802646 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:06:13.802646 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:06:13.804187 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f' to be skipped because of status 'skipped'. 
[0m06:06:13.804187 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:06:13.805864 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:06:13.806869 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:06:13.815325 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:06:13.819009 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:06:13.823154 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:06:13.825172 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:06:13.826784 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:06:13.827104 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.828311 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:13.828311 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:06:13.828311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:06:13.832054 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:06:13.836755 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:06:13.838842 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:06:13.839845 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:06:13.840860 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.03s]
[0m06:06:13.842560 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:06:13.842560 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:06:13.843576 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:06:13.844609 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:06:13.846130 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:06:13.852970 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:06:13.855493 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:06:13.861944 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:06:13.863543 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:06:13.864641 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:06:13.865670 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:13.867211 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:06:13.867850 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:06:13.867850 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:06:32.301278 [debug] [Thread-1 (]: SQL status: OK in 18.432 seconds
[0m06:06:32.307386 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:06:32.308385 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:06:32.310061 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:32.311448 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:06:32.313033 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:06:32.313633 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:06:32.619312 [debug] [Thread-1 (]: SQL status: OK in 0.305 seconds
[0m06:06:32.623991 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:06:32.624992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:06:32.627001 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:32.629595 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:06:32.629595 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860F861B0>]}
[0m06:06:32.631279 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 18.78s]
[0m06:06:32.632307 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:06:32.633445 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:06:32.634951 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:06:32.636571 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:06:32.637570 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:06:32.647475 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:06:32.650525 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:06:32.657974 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:06:32.659107 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:06:32.660110 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:06:32.661302 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:32.662573 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:32.662573 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:06:32.663583 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:06:33.037923 [debug] [Thread-1 (]: SQL status: OK in 0.373 seconds
[0m06:06:33.043425 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:06:33.044469 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:06:33.045971 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:33.048027 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:06:33.048027 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:06:33.049056 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:06:33.060567 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:06:33.065502 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:06:33.065502 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:06:33.067598 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:06:33.069145 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:06:33.070841 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860F72150>]}
[0m06:06:33.073416 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.44s]
[0m06:06:33.076568 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:06:33.077090 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:06:33.077090 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:06:33.078533 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:06:33.079290 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:06:33.088190 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:06:33.090795 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:06:33.097390 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:06:33.100320 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:06:33.101342 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:06:33.101342 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:06:33.102868 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:06:33.104437 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:06:33.105443 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:07:02.885786 [debug] [Thread-1 (]: SQL status: OK in 29.780 seconds
[0m06:07:02.891010 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:07:02.892127 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:07:02.893686 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:02.896083 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:07:02.896587 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:07:02.897127 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:07:02.971042 [debug] [Thread-1 (]: SQL status: OK in 0.074 seconds
[0m06:07:02.975825 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:07:02.977429 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:07:02.977990 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:07:02.980542 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:07:02.981203 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8608FDD30>]}
[0m06:07:02.982728 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 29.90s]
[0m06:07:02.985017 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:07:02.985815 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:07:02.988335 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:07:02.988335 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:07:02.990072 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:07:02.997297 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:07:03.000109 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:07:03.011696 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:07:03.015275 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:07:03.015813 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:07:03.015813 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:03.017359 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:03.017978 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:07:03.019534 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:07:03.671477 [debug] [Thread-1 (]: SQL status: OK in 0.652 seconds
[0m06:07:03.675655 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:07:03.677335 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:07:03.677953 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:03.681163 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:07:03.682185 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:07:03.682729 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:07:03.696858 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m06:07:03.700110 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:07:03.702122 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:07:03.702667 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:03.706773 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:07:03.706773 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F872342E70>]}
[0m06:07:03.708296 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.72s]
[0m06:07:03.711691 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:07:03.712720 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:07:03.714074 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:07:03.714650 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:07:03.715800 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:07:03.723328 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:07:03.725861 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:07:03.732223 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:07:03.733777 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:07:03.735302 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:07:03.735974 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:03.735974 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:03.737596 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:07:03.737898 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:07:04.600904 [debug] [Thread-1 (]: SQL status: OK in 0.862 seconds
[0m06:07:04.606788 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:07:04.607790 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:07:04.608789 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:04.612768 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:07:04.613244 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:07:04.614355 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:07:04.720481 [debug] [Thread-1 (]: SQL status: OK in 0.107 seconds
[0m06:07:04.727676 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:07:04.727676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:07:04.728274 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:07:04.731980 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:07:04.732285 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd13bdf90-a459-4e70-a722-a9f708057ff3', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860F44AA0>]}
[0m06:07:04.733231 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 1.02s]
[0m06:07:04.735230 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:07:04.735740 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:07:04.736747 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:07:04.737750 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:07:04.738255 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:07:04.748091 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:07:04.751316 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:07:04.755478 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:07:04.759257 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:07:04.759810 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:07:04.760841 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:04.762467 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:04.762467 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:07:04.762467 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:07:04.765594 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:07:04.767921 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:07:04.769626 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:07:04.770653 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:07:04.772176 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.03s]
[0m06:07:04.773961 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:07:04.775475 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:07:04.775475 [info ] [Thread-1 (]: 87 of 97 SKIP test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[33mSKIP[0m]
[0m06:07:04.778096 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:07:04.779764 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:07:04.781306 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e' to be skipped because of status 'skipped'. 
[0m06:07:04.779764 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:07:04.782347 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:07:04.782883 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:07:04.793715 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:07:04.796870 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:07:04.802851 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:07:04.805394 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:07:04.806635 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:07:04.808144 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:04.809165 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:04.810668 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:07:04.811279 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:07:04.815759 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:07:04.819556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:07:04.821578 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:07:04.822578 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:07:04.823765 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.04s]
[0m06:07:04.827403 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:07:04.828989 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:07:04.829991 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:07:04.832383 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:07:04.832383 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:07:04.842445 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:07:04.846080 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:07:04.851054 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:07:04.852078 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:07:04.853063 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:07:04.853063 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:04.853569 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:07:04.854072 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:07:04.854072 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:07:04.855595 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:04.856907 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:07:04.858430 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:07:04.860103 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:07:04.861119 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.03s]
[0m06:07:04.861632 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:07:04.862685 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:07:04.862685 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:07:04.863939 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:07:04.864948 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:07:04.873440 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:07:04.875842 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:07:04.879731 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:07:04.883684 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:07:04.883684 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:07:04.885531 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:04.886665 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:04.887662 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:07:04.887662 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:07:04.892244 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:07:04.894236 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:07:04.898161 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:07:04.899296 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:07:04.901041 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.04s]
[0m06:07:04.904426 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:07:04.905535 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:07:04.906824 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:07:04.908340 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:07:04.909987 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:07:04.920424 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:07:04.923819 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:07:04.930934 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:07:04.933186 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:07:04.934212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:07:04.934212 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:04.936240 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:04.936977 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:07:04.936977 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:07:04.939939 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:04.943041 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:07:04.944550 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:07:04.944550 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:07:04.946091 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.04s]
[0m06:07:04.947133 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:07:04.948852 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:07:04.949857 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:07:04.950337 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:07:04.950337 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:07:04.957426 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:07:04.960515 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:07:04.967596 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:07:04.969144 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:07:04.970382 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:07:04.971399 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:04.972764 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:07:04.973744 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:07:04.973744 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:07:04.976287 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:04.980201 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:07:04.982501 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:07:04.982501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:07:04.982501 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.03s]
[0m06:07:04.986827 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:07:04.987807 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:07:04.988309 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:07:04.989915 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:07:04.990947 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:07:04.997640 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:07:04.998159 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:07:05.004167 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:07:05.008761 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:07:05.010276 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:07:05.010796 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:05.011378 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:05.012383 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:07:05.012383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:07:05.014905 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:05.016982 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:07:05.018526 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:07:05.019047 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:07:05.020075 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.03s]
[0m06:07:05.021080 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:07:05.023010 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:07:05.024015 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:07:05.025521 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:07:05.025521 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:07:05.033720 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:07:05.036802 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:07:05.040701 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:07:05.042874 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:07:05.043460 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:07:05.044177 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:05.044177 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:05.045788 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:07:05.046528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:07:05.048229 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:05.050874 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:07:05.051875 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:07:05.052855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:07:05.052855 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.03s]
[0m06:07:05.054611 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:07:05.055625 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:07:05.056740 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:07:05.057275 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:07:05.057275 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:07:05.067878 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:07:05.069293 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:07:05.073648 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:07:05.076199 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:07:05.077186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:07:05.078502 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:05.080564 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:07:05.081094 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:07:05.082123 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:07:05.088342 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:07:05.092063 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:07:05.094221 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:07:05.094221 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:07:05.096342 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.04s]
[0m06:07:05.097564 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:07:05.098549 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:07:05.098902 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:07:05.099919 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:07:05.100950 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:07:05.107676 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:07:05.110169 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:07:05.117062 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:07:05.119207 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:07:05.120352 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:07:05.122355 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:05.123596 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:07:05.125651 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:07:05.128091 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:07:05.130806 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:07:05.136633 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:07:05.140959 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:07:05.142603 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:07:05.144857 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.04s]
[0m06:07:05.148818 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:07:05.149830 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:07:05.151958 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:07:05.153978 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:07:05.155874 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:07:05.172557 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:07:05.177576 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:07:05.184258 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:07:05.187818 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:07:05.189628 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:07:05.190995 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:07:05.192950 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:07:05.193800 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:07:05.194808 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:07:05.198050 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:07:05.201584 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:07:05.206378 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:07:05.207047 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:07:05.208952 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.05s]
[0m06:07:05.210968 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:07:05.213798 [debug] [MainThread]: Using duckdb connection "master"
[0m06:07:05.214329 [debug] [MainThread]: On master: BEGIN
[0m06:07:05.214851 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:07:05.215478 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:07:05.215478 [debug] [MainThread]: On master: COMMIT
[0m06:07:05.216491 [debug] [MainThread]: Using duckdb connection "master"
[0m06:07:05.217532 [debug] [MainThread]: On master: COMMIT
[0m06:07:05.218097 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:07:05.219650 [debug] [MainThread]: On master: Close
[0m06:07:05.220647 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:07:05.220647 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:07:05.222167 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:07:05.223175 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:07:05.224193 [info ] [MainThread]: 
[0m06:07:05.225207 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 1 minutes and 7.59 seconds (67.59s).
[0m06:07:05.254308 [debug] [MainThread]: Command end result
[0m06:07:05.351453 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:07:05.358840 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:07:05.378834 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:07:05.379825 [info ] [MainThread]: 
[0m06:07:05.380893 [info ] [MainThread]: [31mCompleted with 1 error, 0 partial successes, and 0 warnings:[0m
[0m06:07:05.383389 [info ] [MainThread]: 
[0m06:07:05.385381 [error] [MainThread]: [31mFailure in model dim_instituicao (models\gold\dim_instituicao.sql)[0m
[0m06:07:05.386731 [error] [MainThread]:   Runtime Error in model dim_instituicao (models\gold\dim_instituicao.sql)
  Parser Error: syntax error at or near "FROM"
[0m06:07:05.386731 [info ] [MainThread]: 
[0m06:07:05.388227 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\dim_instituicao.sql
[0m06:07:05.388227 [info ] [MainThread]: 
[0m06:07:05.389800 [info ] [MainThread]: Done. PASS=80 WARN=0 ERROR=1 SKIP=16 NO-OP=0 TOTAL=97
[0m06:07:05.392092 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 21 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:07:05.394332 [debug] [MainThread]: Command `dbt build` failed at 06:07:05.394332 after 70.85 seconds
[0m06:07:05.395839 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F85C0A19A0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F8723E8110>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F860F925D0>]}
[0m06:07:05.395839 [debug] [MainThread]: Flushing usage events
[0m06:07:06.352725 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:09:25.538158 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186925CB110>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186925CA180>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186925CAED0>]}


============================== 06:09:25.543690 | 18c437c9-a6d3-47c2-811f-bb93a1d9adea ==============================
[0m06:09:25.543690 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:09:25.543690 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'fail_fast': 'False', 'debug': 'False', 'log_format': 'default', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'indirect_selection': 'eager', 'use_colors': 'True', 'invocation_command': 'dbt build', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:09:25.762390 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018693E9C7A0>]}
[0m06:09:25.814632 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018693E6B680>]}
[0m06:09:25.817541 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:09:26.065759 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:09:26.236033 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed.
[0m06:09:26.238298 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m06:09:26.238298 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_capital_prudencial.sql
[0m06:09:26.238298 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m06:09:26.238298 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m06:09:26.238298 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m06:09:26.238298 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m06:09:26.239889 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m06:09:26.239889 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m06:09:26.239889 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\dim_instituicao.sql
[0m06:09:26.612838 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:09:26.613386 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018693EBEF60>]}
[0m06:09:26.769985 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:09:26.781188 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186943B98E0>]}
[0m06:09:26.868933 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:09:26.870937 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:09:26.918968 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694722660>]}
[0m06:09:26.919479 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:09:26.926069 [info ] [MainThread]: 
[0m06:09:26.926069 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:09:26.927071 [info ] [MainThread]: 
[0m06:09:26.927579 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:09:26.932141 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:09:26.997997 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:09:26.997997 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:09:26.997997 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:09:27.090752 [debug] [ThreadPool]: SQL status: OK in 0.093 seconds
[0m06:09:27.092398 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:09:27.093457 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:09:27.093457 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:09:27.098528 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:09:27.098528 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:09:27.098528 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:09:27.099554 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:09:27.100157 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:09:27.101193 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:09:27.101193 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:09:27.101193 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:09:27.101193 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:09:27.101193 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:09:27.102705 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:09:27.102705 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:09:27.102705 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:09:27.102705 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:09:27.102705 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:09:27.106175 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:09:27.110309 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:09:27.110913 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:09:27.110913 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:09:27.112425 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:09:27.112425 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:09:27.112425 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:09:27.130749 [debug] [ThreadPool]: SQL status: OK in 0.018 seconds
[0m06:09:27.132310 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:09:27.133460 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:09:27.133460 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:09:27.135099 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001868FA1E570>]}
[0m06:09:27.135725 [debug] [MainThread]: Using duckdb connection "master"
[0m06:09:27.135725 [debug] [MainThread]: On master: BEGIN
[0m06:09:27.135725 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:09:27.136756 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:09:27.136756 [debug] [MainThread]: On master: COMMIT
[0m06:09:27.136756 [debug] [MainThread]: Using duckdb connection "master"
[0m06:09:27.136756 [debug] [MainThread]: On master: COMMIT
[0m06:09:27.137746 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:09:27.137746 [debug] [MainThread]: On master: Close
[0m06:09:27.143663 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:09:27.144949 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:09:27.145455 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:09:27.146002 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:09:27.158325 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:09:27.159921 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:09:27.184020 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:09:27.185019 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:09:27.185019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:09:27.185659 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:09:27.185659 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:27.185659 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:09:27.186688 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
    );
  
  
[0m06:09:27.682661 [debug] [Thread-1 (]: SQL status: OK in 0.495 seconds
[0m06:09:27.687794 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:09:27.688300 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:09:27.688300 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:27.698392 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:09:27.698392 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:09:27.698392 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:09:27.725328 [debug] [Thread-1 (]: SQL status: OK in 0.026 seconds
[0m06:09:27.729655 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:09:27.729655 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:09:27.730685 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:27.732749 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:09:27.733744 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186946DF4D0>]}
[0m06:09:27.735250 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.59s]
[0m06:09:27.735817 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:09:27.735817 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:09:27.735817 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:09:27.736822 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:09:27.736822 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:09:27.739940 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:09:27.740952 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:09:27.743432 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:09:27.743432 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:09:27.744460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:09:27.744460 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:27.744460 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:27.745443 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:09:27.745443 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:09:27.796692 [debug] [Thread-1 (]: SQL status: OK in 0.051 seconds
[0m06:09:27.798573 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:09:27.799620 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:09:27.800126 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:27.800126 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:09:27.800126 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:09:27.801667 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:09:27.802746 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:27.805273 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:09:27.805273 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:09:27.805273 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:27.806280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:09:27.807282 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DE7B90>]}
[0m06:09:27.807282 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.07s]
[0m06:09:27.808395 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:09:27.808395 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:09:27.808395 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:09:27.809988 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:09:27.809988 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:09:27.818908 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:09:27.819935 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:09:27.820931 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:09:27.822459 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:09:27.823476 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:09:27.823476 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:27.824987 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:27.824987 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:09:27.825729 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:09:27.896783 [debug] [Thread-1 (]: SQL status: OK in 0.071 seconds
[0m06:09:27.899500 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:09:27.899500 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:09:27.900068 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:27.901098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:09:27.901098 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:09:27.901098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:09:27.902609 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:27.905309 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:09:27.905309 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:09:27.906385 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:27.906385 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:09:27.907403 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DBBFE0>]}
[0m06:09:27.907403 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m06:09:27.908416 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:09:27.908416 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:09:27.909968 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:09:27.909968 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:09:27.909968 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:09:27.914581 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:09:27.915591 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:09:27.919821 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:09:27.920828 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:09:27.920828 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:09:27.920828 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:27.922340 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:27.922340 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:09:27.923351 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || '')
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:09:28.700252 [debug] [Thread-1 (]: SQL status: OK in 0.776 seconds
[0m06:09:28.702883 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:09:28.703919 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:09:28.704424 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:28.706464 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:09:28.706464 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:09:28.707482 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:09:28.945458 [debug] [Thread-1 (]: SQL status: OK in 0.238 seconds
[0m06:09:28.947917 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:09:28.947917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:09:28.948558 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:28.949569 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:09:28.950088 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DB6E70>]}
[0m06:09:28.950088 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 1.04s]
[0m06:09:28.951101 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:09:28.952103 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:09:28.952103 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:09:28.953101 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:09:28.953101 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:09:28.955716 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:09:28.956746 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:09:28.959817 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:09:28.960847 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:09:28.960847 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:09:28.961916 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:28.962419 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:28.962419 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:09:28.962419 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:09:29.131389 [debug] [Thread-1 (]: SQL status: OK in 0.169 seconds
[0m06:09:29.133862 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:09:29.133862 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:09:29.135468 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:29.135468 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:09:29.136581 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:09:29.136581 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:09:29.149685 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m06:09:29.151327 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:09:29.152836 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:09:29.152836 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:29.154225 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:09:29.155951 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694E2F0B0>]}
[0m06:09:29.155951 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.20s]
[0m06:09:29.156960 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:09:29.156960 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:09:29.156960 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:09:29.158503 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:09:29.158503 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:09:29.161357 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:09:29.163142 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:09:29.165914 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:09:29.167045 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:09:29.167045 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:09:29.168051 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:29.168051 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:29.169055 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:09:29.169564 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:09:29.210234 [debug] [Thread-1 (]: SQL status: OK in 0.040 seconds
[0m06:09:29.212131 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:09:29.212829 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:09:29.212829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:29.214346 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:09:29.214346 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:09:29.214853 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:09:29.235104 [debug] [Thread-1 (]: SQL status: OK in 0.020 seconds
[0m06:09:29.237538 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:09:29.237538 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:09:29.237538 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:29.238613 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:09:29.238613 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694E28380>]}
[0m06:09:29.239834 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.08s]
[0m06:09:29.239834 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:09:29.239834 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:09:29.240948 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:09:29.240948 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:09:29.241958 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:09:29.246746 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:09:29.247451 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:09:29.251353 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:09:29.251353 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:09:29.252863 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:09:29.252863 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:29.253872 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:29.253872 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:09:29.253872 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:09:29.301214 [debug] [Thread-1 (]: SQL status: OK in 0.048 seconds
[0m06:09:29.304898 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:09:29.305408 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:09:29.305408 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:29.306425 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:09:29.307477 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:09:29.307477 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:09:29.388004 [debug] [Thread-1 (]: SQL status: OK in 0.080 seconds
[0m06:09:29.389604 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:09:29.389604 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:09:29.390674 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:29.391273 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:09:29.391273 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694D9D2B0>]}
[0m06:09:29.392287 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.15s]
[0m06:09:29.392845 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:09:29.393460 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:09:29.393460 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:09:29.394471 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:09:29.394471 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:09:29.398493 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:09:29.400026 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:09:29.402698 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:09:29.402698 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:09:29.402698 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:09:29.404327 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:29.404327 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:29.404327 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:09:29.405347 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:09:30.025553 [debug] [Thread-1 (]: SQL status: OK in 0.620 seconds
[0m06:09:30.028087 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:09:30.028599 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:09:30.028599 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.029612 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:09:30.030628 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:09:30.030628 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:09:30.188319 [debug] [Thread-1 (]: SQL status: OK in 0.158 seconds
[0m06:09:30.190504 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:09:30.191150 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:09:30.191150 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.193173 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:09:30.194179 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694C9D730>]}
[0m06:09:30.194179 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.80s]
[0m06:09:30.194179 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:09:30.195686 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:09:30.196294 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:09:30.196956 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:09:30.196956 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:09:30.201069 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:09:30.202577 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:09:30.204151 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:09:30.205796 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:09:30.205796 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:09:30.205796 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.206804 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.208375 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:09:30.208375 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:09:30.213727 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:09:30.217238 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:09:30.217238 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:09:30.217896 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.219009 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:09:30.219009 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:09:30.219009 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:09:30.223349 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:09:30.225873 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:09:30.225873 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:09:30.225873 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.227379 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:09:30.228386 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186B388CAD0>]}
[0m06:09:30.228892 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.03s]
[0m06:09:30.229446 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:09:30.229446 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:09:30.230453 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:09:30.230958 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:09:30.230958 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:09:30.233307 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:09:30.234298 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:09:30.236851 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:09:30.238371 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:09:30.238371 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:09:30.238371 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.238371 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.239903 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:09:30.239903 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar))
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:09:30.271492 [debug] [Thread-1 (]: SQL status: OK in 0.031 seconds
[0m06:09:30.274078 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:09:30.274078 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:09:30.275078 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.276170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:09:30.276170 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:09:30.276170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:09:30.283232 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:09:30.285850 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:09:30.286576 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:09:30.286576 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.288099 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:09:30.288449 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694E002C0>]}
[0m06:09:30.289149 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.06s]
[0m06:09:30.289653 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:09:30.289653 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:09:30.290658 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:09:30.291162 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:09:30.291162 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:09:30.293656 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:09:30.295685 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:09:30.298878 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:09:30.299421 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:09:30.299421 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:09:30.300449 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.300449 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.300449 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:09:30.300449 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar))
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:09:30.563987 [debug] [Thread-1 (]: SQL status: OK in 0.263 seconds
[0m06:09:30.565858 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:09:30.565858 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:09:30.567485 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.568117 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:09:30.568117 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:09:30.569122 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:09:30.720997 [debug] [Thread-1 (]: SQL status: OK in 0.152 seconds
[0m06:09:30.724087 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:09:30.725093 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:09:30.725598 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.725598 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:09:30.727104 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186B38A87A0>]}
[0m06:09:30.727104 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.43s]
[0m06:09:30.728110 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:09:30.728110 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:09:30.728110 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:09:30.728110 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:09:30.729856 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:09:30.729856 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:09:30.744046 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:09:30.745570 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:09:30.745570 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.746337 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.746337 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:09:30.746337 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:09:30.747040 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.754259 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:09:30.754259 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.758480 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:09:30.762752 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:09:30.764792 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:09:30.765321 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:09:30.765321 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:09:30.766981 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:30.768112 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:09:30.768112 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DEBB00>]}
[0m06:09:30.768112 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.04s]
[0m06:09:30.769619 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:09:30.769619 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:09:30.770624 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:09:30.772130 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:09:30.772130 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:09:30.773139 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:09:30.777150 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:09:30.777876 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:09:30.777876 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.777876 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.777876 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:09:30.777876 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:09:30.779496 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.779496 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:09:30.779496 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.782145 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.782145 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:09:30.784192 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:09:30.784192 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:09:30.784192 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:09:30.785706 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.785706 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:09:30.786728 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DA0140>]}
[0m06:09:30.786728 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.01s]
[0m06:09:30.787727 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:09:30.788233 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:09:30.788233 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:09:30.788233 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:09:30.789854 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:09:30.789854 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:09:30.792887 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:09:30.792887 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:09:30.793473 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.793473 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.793473 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:09:30.794476 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:09:30.794476 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.795497 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:09:30.796020 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.796570 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.797831 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:09:30.799446 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:09:30.799446 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:09:30.799951 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:09:30.800957 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.800957 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:09:30.801958 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694756ED0>]}
[0m06:09:30.802991 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.01s]
[0m06:09:30.803525 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:09:30.804032 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:09:30.804032 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:09:30.804032 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:09:30.804032 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:09:30.805581 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:09:30.807118 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:09:30.807118 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:09:30.808640 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.808640 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.808640 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:09:30.808640 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:09:30.808640 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.810347 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:09:30.810996 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.812631 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:30.813138 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:09:30.814679 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:09:30.814679 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:09:30.815318 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:09:30.815945 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.816958 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:09:30.817461 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DD33B0>]}
[0m06:09:30.817461 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.01s]
[0m06:09:30.818039 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:09:30.819051 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:09:30.819051 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:09:30.819051 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:09:30.819051 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:09:30.820324 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:09:30.822856 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:09:30.822856 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:09:30.822856 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.823850 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.823850 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:09:30.823850 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:09:30.825356 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.826363 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:09:30.826363 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.828538 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:30.828538 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:09:30.830550 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:09:30.830550 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:09:30.831206 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:09:30.832216 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.832216 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:09:30.833493 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694E0CBC0>]}
[0m06:09:30.833493 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.01s]
[0m06:09:30.834997 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:09:30.834997 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:09:30.835628 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:09:30.835628 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:09:30.835628 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:09:30.836635 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:09:30.839779 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:09:30.839779 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:09:30.840872 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.841396 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.841396 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:09:30.841922 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:09:30.841922 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.843450 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:09:30.843450 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.844492 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.845460 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:09:30.847199 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:09:30.847199 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:09:30.847783 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:09:30.848323 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.848323 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:09:30.849997 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DD92B0>]}
[0m06:09:30.849997 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.01s]
[0m06:09:30.851010 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:09:30.851010 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:09:30.852011 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:09:30.852011 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:09:30.852011 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:09:30.853029 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:09:30.855632 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:09:30.855632 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:09:30.855632 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.857152 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.857152 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:09:30.857152 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:09:30.857152 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.858669 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:09:30.858669 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.860937 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:30.862048 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:09:30.863570 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:09:30.864103 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:09:30.864103 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:09:30.865185 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.865722 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:09:30.865722 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694CC1280>]}
[0m06:09:30.865722 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.01s]
[0m06:09:30.866733 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:09:30.867236 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:09:30.867795 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:09:30.868344 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:09:30.868947 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:09:30.868947 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:09:30.870973 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:09:30.872486 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:09:30.872486 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.873490 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.873490 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:09:30.873490 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:09:30.873490 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.874993 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:09:30.875609 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.875609 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.875609 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:09:30.879045 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:09:30.880082 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:09:30.880624 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:09:30.881173 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.882213 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:09:30.882764 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694B963C0>]}
[0m06:09:30.882764 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.01s]
[0m06:09:30.883777 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:09:30.883777 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:09:30.883777 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:09:30.883777 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:09:30.885305 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:09:30.885305 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:09:30.888446 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:09:30.888446 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:09:30.888446 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.888446 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.890054 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:09:30.890054 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:09:30.890707 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.890707 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:09:30.890707 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.892945 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.893710 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:09:30.894716 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:09:30.895717 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:09:30.895717 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:09:30.896985 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.897993 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:09:30.898499 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694CB4860>]}
[0m06:09:30.898499 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.01s]
[0m06:09:30.899503 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:09:30.899503 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:09:30.900091 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:09:30.900091 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:09:30.901097 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:09:30.901097 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:09:30.905655 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:09:30.905655 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:09:30.905655 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.906683 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.906683 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:09:30.906683 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:09:30.907675 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:30.908661 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:09:30.909165 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:09:30.911685 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:30.912714 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:09:30.913910 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:09:30.913910 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:09:30.913910 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:09:30.915492 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.916528 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:09:30.917036 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DB1DC0>]}
[0m06:09:30.918040 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.02s]
[0m06:09:30.918546 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:09:30.919049 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:09:30.919049 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m06:09:30.919855 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:09:30.919855 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:09:30.925824 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:09:30.925824 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:09:30.941226 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:09:30.943734 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:09:30.943734 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:09:30.945761 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:30.947560 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.948079 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:09:30.949102 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:30.951183 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:30.956733 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:09:30.959787 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:09:30.960329 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:09:30.961934 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.04s]
[0m06:09:30.963989 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:09:30.964648 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:09:30.965247 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:09:30.966978 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:09:30.967495 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:09:30.978066 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:09:30.981318 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:09:31.044215 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:09:31.046432 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:09:31.046432 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:09:31.047079 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.047079 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.048090 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:09:31.048600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.049606 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.051229 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:09:31.051229 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:09:31.051229 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:09:31.053003 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.09s]
[0m06:09:31.054012 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:09:31.054012 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:09:31.054012 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:09:31.055607 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:09:31.056617 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:09:31.064496 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:09:31.065512 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:09:31.069074 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:09:31.070084 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:09:31.070084 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:09:31.071083 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.071083 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.072108 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:09:31.072108 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:09:31.076237 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:09:31.078445 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:09:31.079456 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:09:31.079967 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:09:31.079967 [error] [Thread-1 (]: 24 of 97 FAIL 8897 unique_dim_instituicao_id_instituicao ....................... [[31mFAIL 8897[0m in 0.02s]
[0m06:09:31.080976 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:09:31.080976 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:09:31.080976 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37' to be skipped because of status 'fail'.  Reason: Got 8897 results, configured to fail if != 0.
[0m06:09:31.080976 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:09:31.083356 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:09:31.083356 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:09:31.088064 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:09:31.089595 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:09:31.092257 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:09:31.093346 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:09:31.093346 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:09:31.094365 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.094365 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.095361 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:09:31.095877 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.097037 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.098564 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:09:31.100231 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:09:31.100231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:09:31.100231 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m06:09:31.101246 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:09:31.101246 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:09:31.102757 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:09:31.103772 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:09:31.104282 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:09:31.110358 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:09:31.111884 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:09:31.115449 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:09:31.118049 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:09:31.119078 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:09:31.120095 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.121092 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.122096 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:09:31.122612 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.127185 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:09:31.129993 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:09:31.131008 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:09:31.132542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:09:31.133563 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.03s]
[0m06:09:31.135687 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:09:31.135687 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:09:31.136704 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:09:31.138223 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:09:31.138223 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:09:31.145615 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:09:31.148137 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:09:31.151218 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:09:31.154383 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:09:31.155400 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:09:31.155400 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.155910 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.156928 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:09:31.156928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:09:31.161654 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:09:31.165226 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:09:31.167273 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:09:31.167916 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:09:31.169445 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.03s]
[0m06:09:31.170460 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:09:31.171465 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:09:31.171974 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:09:31.172486 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:09:31.173500 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:09:31.178622 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:09:31.180652 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:09:31.183728 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:09:31.186779 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:09:31.187791 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:09:31.187791 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.188384 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.190119 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:09:31.190880 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.192240 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.193349 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:09:31.195893 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:09:31.196413 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:09:31.197138 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:09:31.199687 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:09:31.200330 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:09:31.201351 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:09:31.202871 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:09:31.203890 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:09:31.210226 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:09:31.212846 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:09:31.216399 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:09:31.217924 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:09:31.218431 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:09:31.218938 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.218938 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.219956 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:09:31.219956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:09:31.223480 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:09:31.225495 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:09:31.225495 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:09:31.227256 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:09:31.228274 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m06:09:31.229806 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:09:31.229806 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:09:31.230819 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:09:31.231326 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:09:31.231326 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:09:31.237940 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:09:31.238604 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:09:31.242841 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:09:31.245629 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:09:31.246852 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:09:31.247452 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.249491 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:31.249491 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:09:31.250094 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.251105 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.252615 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:09:31.254137 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:09:31.254137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:09:31.254137 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:09:31.255703 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:09:31.255703 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:09:31.255703 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:09:31.256712 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:09:31.257725 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:09:31.263279 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:09:31.265317 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:09:31.269691 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:09:31.270703 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:09:31.270703 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:09:31.272219 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.273240 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.274233 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:09:31.275240 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.277270 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:31.278786 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:09:31.280808 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:09:31.281318 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:09:31.282843 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.03s]
[0m06:09:31.283867 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:09:31.285382 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:09:31.285382 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:09:31.286905 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:09:31.286905 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:09:31.291269 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:09:31.292914 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:09:31.295527 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:09:31.296772 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:09:31.296772 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:09:31.297463 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.298018 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.298018 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:09:31.298018 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.301259 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:09:31.303776 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:09:31.303776 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:09:31.303776 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:09:31.305367 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:09:31.305367 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:09:31.306388 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:09:31.306388 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:09:31.307383 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:09:31.307383 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:09:31.311081 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:09:31.311691 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:09:31.313220 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:09:31.313745 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:09:31.313745 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:09:31.314771 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.315278 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.315278 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:09:31.315824 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.322207 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:09:31.324215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:09:31.325231 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:09:31.325231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:09:31.325231 [error] [Thread-1 (]: 33 of 97 FAIL 408414 relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 408414[0m in 0.02s]
[0m06:09:31.327417 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:09:31.327417 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:09:31.327965 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01' to be skipped because of status 'fail'.  Reason: Got 408414 results, configured to fail if != 0.
[0m06:09:31.327965 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:09:31.327965 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:09:31.329524 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:09:31.332253 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:09:31.333274 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:09:31.336919 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:09:31.337919 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:09:31.337919 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:09:31.338425 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.338425 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.338425 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:09:31.338425 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.339539 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.341097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:09:31.341097 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:09:31.341097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:09:31.342252 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.01s]
[0m06:09:31.342802 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:09:31.343371 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:09:31.343371 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:09:31.343371 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:09:31.344395 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:09:31.347049 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:09:31.348068 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:09:31.349543 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:09:31.350146 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:09:31.350146 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:09:31.350146 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.351288 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.351288 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:09:31.351288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.352829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.353860 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:09:31.353860 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:09:31.353860 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:09:31.353860 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:09:31.355518 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:09:31.355518 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:09:31.355518 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:09:31.356547 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:09:31.356547 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:09:31.360178 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:09:31.361220 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:09:31.362547 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:09:31.363672 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:09:31.363672 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:09:31.364680 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.365187 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.365187 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:09:31.365765 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.368158 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:31.369163 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:09:31.369163 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:09:31.370208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:09:31.370208 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:09:31.371188 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:09:31.371188 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:09:31.371188 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:09:31.372189 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:09:31.372189 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:09:31.376900 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:09:31.378315 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:09:31.381057 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:09:31.383236 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:09:31.383236 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:09:31.383236 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.383236 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.383236 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:09:31.384745 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.401174 [debug] [Thread-1 (]: SQL status: OK in 0.016 seconds
[0m06:09:31.403700 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:09:31.404339 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:09:31.404339 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:09:31.404339 [error] [Thread-1 (]: 37 of 97 FAIL 158270 relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 158270[0m in 0.03s]
[0m06:09:31.406039 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:09:31.407167 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:09:31.407167 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c' to be skipped because of status 'fail'.  Reason: Got 158270 results, configured to fail if != 0.
[0m06:09:31.407167 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:09:31.408717 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:09:31.408717 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:09:31.412043 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:09:31.412797 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:09:31.413841 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:09:31.414904 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:09:31.414904 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:09:31.415416 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.415416 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.415416 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:09:31.415416 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.417175 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.417835 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:09:31.418602 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:09:31.418602 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:09:31.419306 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m06:09:31.419306 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:09:31.420343 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:09:31.420343 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:09:31.420966 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:09:31.420966 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:09:31.425057 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:09:31.425566 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:09:31.427081 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:09:31.428099 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:09:31.428099 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:09:31.428099 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.428099 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.429858 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:09:31.429858 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.430890 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.432697 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:09:31.432697 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:09:31.433725 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:09:31.433725 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:09:31.433725 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:09:31.433725 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:09:31.435242 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:09:31.436156 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:09:31.436156 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:09:31.440988 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:09:31.441998 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:09:31.444743 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:09:31.445741 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:09:31.446358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:09:31.446358 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.446937 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.446937 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:09:31.446937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.447946 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:31.450991 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:09:31.450991 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:09:31.450991 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:09:31.450991 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:09:31.452546 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:09:31.452546 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:09:31.452546 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:09:31.454287 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:09:31.454287 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:09:31.458629 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:09:31.458629 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:09:31.462439 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:09:31.462439 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:09:31.462439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:09:31.462439 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.464097 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.464097 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:09:31.464681 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.471172 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:09:31.473225 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:09:31.473225 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:09:31.474253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:09:31.474253 [error] [Thread-1 (]: 41 of 97 FAIL 71836 relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 71836[0m in 0.02s]
[0m06:09:31.475868 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:09:31.475868 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:09:31.476931 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29' to be skipped because of status 'fail'.  Reason: Got 71836 results, configured to fail if != 0.
[0m06:09:31.475868 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:09:31.477435 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:09:31.478092 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:09:31.479948 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:09:31.481465 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:09:31.482864 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:09:31.483894 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:09:31.484866 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:09:31.484866 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.485371 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.485371 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:09:31.485371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.486383 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.488086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:09:31.488902 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:09:31.488902 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:09:31.488902 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m06:09:31.489902 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:09:31.489902 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:09:31.490906 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:09:31.490906 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:09:31.490906 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:09:31.494690 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:09:31.494690 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:09:31.496693 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:09:31.497340 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:09:31.497340 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:09:31.498345 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.498345 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.498345 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:09:31.499412 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.499412 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.501060 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:09:31.501060 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:09:31.502067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:09:31.502067 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.01s]
[0m06:09:31.503068 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:09:31.503068 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:09:31.504089 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:09:31.504089 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:09:31.504089 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:09:31.508206 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:09:31.508711 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:09:31.510768 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:09:31.510768 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:09:31.512263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:09:31.512263 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.512898 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.512898 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:09:31.512898 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.515609 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:31.515609 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:09:31.517410 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:09:31.517410 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:09:31.517410 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:09:31.519100 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:09:31.519100 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:09:31.519100 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:09:31.520131 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:09:31.520131 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:09:31.524306 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:09:31.525306 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:09:31.526844 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:09:31.528379 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:09:31.528820 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:09:31.528820 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.528820 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.528820 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:09:31.529843 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.537575 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:09:31.538598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:09:31.540913 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:09:31.541232 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:09:31.541232 [error] [Thread-1 (]: 45 of 97 FAIL 71836 relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 71836[0m in 0.02s]
[0m06:09:31.542240 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:09:31.542925 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:09:31.542925 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33' to be skipped because of status 'fail'.  Reason: Got 71836 results, configured to fail if != 0.
[0m06:09:31.542925 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:09:31.543663 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:09:31.543663 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:09:31.548454 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:09:31.548454 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:09:31.550931 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:09:31.551937 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:09:31.552938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:09:31.552938 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.553443 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.553950 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:09:31.553950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.553950 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.555491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:09:31.556498 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:09:31.556498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:09:31.557504 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m06:09:31.557504 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:09:31.558503 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:09:31.559057 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:09:31.559057 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:09:31.560086 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:09:31.562846 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:09:31.563852 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:09:31.565556 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:09:31.565556 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:09:31.565556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:09:31.567303 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.567831 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.567831 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:09:31.568439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.568981 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.570004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:09:31.571001 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:09:31.571001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:09:31.571001 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m06:09:31.572001 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:09:31.572001 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:09:31.573121 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:09:31.573121 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:09:31.573121 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:09:31.577148 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:09:31.578178 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:09:31.580857 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:09:31.582372 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:09:31.582372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:09:31.583399 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.584914 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.584914 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:09:31.584914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.588524 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:09:31.590034 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:09:31.591040 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:09:31.591040 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:09:31.591544 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:09:31.592548 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:09:31.592548 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:09:31.592548 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:09:31.593554 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:09:31.593554 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:09:31.598049 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:09:31.599055 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:09:31.601080 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:09:31.601080 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:09:31.601080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:09:31.602586 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.602586 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.602586 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:09:31.602586 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.609917 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:09:31.610928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:09:31.612568 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:09:31.612568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:09:31.612568 [error] [Thread-1 (]: 49 of 97 FAIL 408408 relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 408408[0m in 0.02s]
[0m06:09:31.614350 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:09:31.614897 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:09:31.614897 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71' to be skipped because of status 'fail'.  Reason: Got 408408 results, configured to fail if != 0.
[0m06:09:31.614897 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:09:31.616750 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:09:31.616750 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:09:31.619587 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:09:31.620597 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:09:31.621581 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:09:31.623133 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:09:31.623133 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:09:31.623133 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.624129 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.624129 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:09:31.624129 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.626072 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.627958 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:09:31.627958 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:09:31.628963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:09:31.628963 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m06:09:31.629965 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:09:31.630469 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:09:31.631107 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:09:31.632133 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:09:31.633240 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:09:31.639503 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:09:31.641203 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:09:31.644026 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:09:31.646213 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:09:31.646213 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:09:31.646843 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.647500 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.647500 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:09:31.648027 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.648027 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.649797 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:09:31.650358 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:09:31.650358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:09:31.651370 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m06:09:31.651370 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:09:31.651370 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:09:31.652875 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:09:31.653879 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:09:31.653879 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:09:31.657451 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:09:31.658957 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:09:31.662317 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:09:31.663693 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:09:31.663693 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:09:31.663693 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.665201 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.665201 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:09:31.665985 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.665985 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.668132 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:09:31.669648 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:09:31.669648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:09:31.670655 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:09:31.670655 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:09:31.670655 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:09:31.670655 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:09:31.672160 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:09:31.673166 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:09:31.675672 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:09:31.677177 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:09:31.678690 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:09:31.680256 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:09:31.680769 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:09:31.680769 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.681486 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.681486 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:09:31.681486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.684147 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:09:31.685654 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:09:31.686660 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:09:31.686660 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:09:31.687660 [error] [Thread-1 (]: 53 of 97 FAIL 5517 relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 5517[0m in 0.01s]
[0m06:09:31.688165 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:09:31.688165 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:09:31.688165 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59' to be skipped because of status 'fail'.  Reason: Got 5517 results, configured to fail if != 0.
[0m06:09:31.688165 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:09:31.689761 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:09:31.689761 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:09:31.692512 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:09:31.694025 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:09:31.695532 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:09:31.696539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:09:31.697044 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:09:31.697044 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.697549 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.698095 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:09:31.698095 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.698095 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.700214 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:09:31.700214 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:09:31.701221 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:09:31.701221 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m06:09:31.701221 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:09:31.701221 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:09:31.702726 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:09:31.702726 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:09:31.702726 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:09:31.706751 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:09:31.706751 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:09:31.710946 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:09:31.711960 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:09:31.712466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:09:31.712466 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.712466 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.712466 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:09:31.712466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.714139 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.715244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:09:31.715824 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:09:31.715824 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:09:31.717210 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:09:31.717794 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:09:31.717794 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:09:31.718320 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:09:31.718320 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:09:31.719460 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:09:31.724244 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:09:31.725780 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:09:31.728123 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:09:31.729724 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:09:31.729724 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:09:31.729724 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.730731 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.731237 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:09:31.731237 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.733753 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:31.733753 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:09:31.735287 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:09:31.736091 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:09:31.736091 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:09:31.736091 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:09:31.737746 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:09:31.737746 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:09:31.738339 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:09:31.738339 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:09:31.742581 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:09:31.743947 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:09:31.746748 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:09:31.748035 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:09:31.748035 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:09:31.748956 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.748956 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.749465 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:09:31.749465 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.757041 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:09:31.758658 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:09:31.759766 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:09:31.760374 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:09:31.760374 [error] [Thread-1 (]: 57 of 97 FAIL 71836 relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 71836[0m in 0.02s]
[0m06:09:31.760977 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:09:31.760977 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:09:31.760977 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871' to be skipped because of status 'fail'.  Reason: Got 71836 results, configured to fail if != 0.
[0m06:09:31.762138 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:09:31.762706 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:09:31.762706 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:09:31.765946 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:09:31.765946 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:09:31.768446 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:09:31.769014 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:09:31.770057 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:09:31.770057 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.771067 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.771067 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:09:31.772067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.772574 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.773710 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:09:31.773710 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:09:31.775269 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:09:31.775269 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:09:31.776278 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:09:31.776278 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:09:31.776278 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:09:31.777280 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:09:31.777806 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:09:31.780163 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:09:31.781415 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:09:31.783034 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:09:31.784303 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:09:31.784816 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:09:31.784816 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.785836 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.785836 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:09:31.785836 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.787526 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.789045 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:09:31.789552 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:09:31.789552 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:09:31.791262 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:09:31.792825 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:09:31.793381 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:09:31.793381 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:09:31.793381 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:09:31.793381 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:09:31.798185 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:09:31.799816 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:09:31.801829 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:09:31.803839 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:09:31.803839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:09:31.803839 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.804659 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.804659 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:09:31.804659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.808375 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:31.808375 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:09:31.810089 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:09:31.810089 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:09:31.810838 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:09:31.811850 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:09:31.812358 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:09:31.812358 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:09:31.812951 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:09:31.813672 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:09:31.818232 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:09:31.819242 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:09:31.820622 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:09:31.823260 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:09:31.823260 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:09:31.823260 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.824259 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.824766 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:09:31.824766 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:31.830763 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:09:31.831846 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:09:31.832857 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:09:31.833861 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:09:31.833861 [error] [Thread-1 (]: 61 of 97 FAIL 408335 relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 408335[0m in 0.02s]
[0m06:09:31.834985 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:09:31.835609 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:09:31.835609 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a' to be skipped because of status 'fail'.  Reason: Got 408335 results, configured to fail if != 0.
[0m06:09:31.835609 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:09:31.836722 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:09:31.836722 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:09:31.838333 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:09:31.840553 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:09:31.842943 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:09:31.843676 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:09:31.843676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:09:31.843676 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.845673 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.845673 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:09:31.846245 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:09:31.846933 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.849465 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:09:31.849465 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:09:31.849465 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.850655 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:09:31.851666 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:09:31.851666 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:09:31.852666 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.854574 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:09:31.854574 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:09:31.855597 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.855597 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:09:31.856692 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001869479E360>]}
[0m06:09:31.856692 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.02s]
[0m06:09:31.857691 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:09:31.857691 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:09:31.858676 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:09:31.858676 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:09:31.858676 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:09:31.861883 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:09:31.862913 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:09:31.865909 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:09:31.866823 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:09:31.867447 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:09:31.867447 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:31.868096 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.868096 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:09:31.868096 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:09:31.869100 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.871338 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:09:31.871338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:09:31.872324 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.872324 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:09:31.872324 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:09:31.872324 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:09:31.873731 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:31.875240 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:09:31.876912 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:09:31.877557 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:31.878551 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:09:31.878551 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186947FAF30>]}
[0m06:09:32.687383 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:09:32.690898 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m06:09:32.693476 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:09:32.694434 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:09:32.695037 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:09:32.697031 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:09:32.697556 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:09:32.701644 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:09:32.704203 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:09:32.708678 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:09:32.709710 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:09:32.710799 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:09:32.710799 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.710799 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.712133 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:09:32.712688 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:09:32.712688 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.715299 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:09:32.715299 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:09:32.715875 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.716903 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:09:32.717411 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:09:32.717751 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:09:32.720921 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:09:32.723452 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:09:32.723452 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:09:32.723452 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.725501 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:09:32.725501 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694E441D0>]}
[0m06:09:32.725501 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:09:32.727195 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:09:32.727761 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:09:32.728292 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:09:32.728292 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:09:32.728292 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:09:32.730852 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:09:32.732447 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:09:32.733968 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:09:32.735475 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:09:32.735475 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:09:32.736587 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.736587 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.736587 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:09:32.737622 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:09:32.738231 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.741389 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:09:32.741911 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:09:32.741911 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.742922 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:09:32.743593 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:09:32.743593 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:09:32.744604 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.746203 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:09:32.746773 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:09:32.746773 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.748303 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:09:32.748303 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001869473D730>]}
[0m06:09:32.748303 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.02s]
[0m06:09:32.749875 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:09:32.749875 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:09:32.749875 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:09:32.750882 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:09:32.750882 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:09:32.753431 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:09:32.753937 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:09:32.756485 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:09:32.756485 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:09:32.757993 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:09:32.757993 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.758519 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.758519 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:09:32.758519 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:09:32.760283 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.762430 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:09:32.762430 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:09:32.762430 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.764139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:09:32.764790 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:09:32.764790 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:09:32.765407 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.766917 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:09:32.767946 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:09:32.767946 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.769031 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:09:32.769536 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001869473D730>]}
[0m06:09:32.769536 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.02s]
[0m06:09:32.770536 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:09:32.770536 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:09:32.770536 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:09:32.770536 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:09:32.772053 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:09:32.773077 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:09:32.775052 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:09:32.777073 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:09:32.777702 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:09:32.778437 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:09:32.778437 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.778437 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.778437 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:09:32.779444 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:09:32.779949 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.781992 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:09:32.781992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:09:32.783067 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.783067 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:09:32.784087 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:09:32.784087 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:09:32.785068 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.787577 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:09:32.788098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:09:32.788098 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.788098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:09:32.789745 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186947F4C20>]}
[0m06:09:32.789745 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.02s]
[0m06:09:32.790756 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:09:32.791261 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:09:32.791261 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:09:32.791261 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:09:32.792265 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:09:32.794676 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:09:32.795653 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:09:32.797961 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:09:32.798493 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:09:32.798493 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:09:32.798493 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.799517 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.800040 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:09:32.800040 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:09:32.800040 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.802571 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:09:32.802571 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:09:32.802571 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.804154 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:09:32.804154 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:09:32.804154 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:09:32.805881 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.806910 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:09:32.808437 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:09:32.808437 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.810116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:09:32.810803 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186940FD520>]}
[0m06:09:32.810803 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m06:09:32.811809 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:09:32.811809 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:09:32.812401 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:09:32.812401 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:09:32.812401 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:09:32.814757 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:09:32.815350 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:09:32.818079 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:09:32.819134 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:09:32.819134 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:09:32.819134 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.820164 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.820164 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:09:32.820164 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:09:32.821212 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.823278 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:09:32.823278 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:09:32.824294 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.825278 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:09:32.825278 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:09:32.825278 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:09:32.826822 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.827937 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:09:32.827937 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:09:32.827937 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.829529 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:09:32.829529 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186B38F5940>]}
[0m06:09:32.830560 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m06:09:32.831194 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:09:32.831194 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:09:32.832205 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:09:32.832205 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:09:32.832205 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:09:32.836441 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:09:32.836441 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:09:32.838209 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:09:32.839803 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:09:32.839803 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:09:32.840810 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.841315 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.841315 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:09:32.841315 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:09:32.842322 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.844562 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:09:32.844562 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:09:32.845544 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.846205 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:09:32.846807 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:09:32.846807 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:09:32.848043 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.849641 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:09:32.850183 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:09:32.850183 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.851212 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:09:32.851212 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018693EBEF60>]}
[0m06:09:32.851212 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m06:09:32.852717 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:09:32.852717 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:09:32.852717 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:09:32.853722 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:09:32.853722 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:09:32.856292 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:09:32.857298 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:09:32.859808 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:09:32.860312 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:09:32.860312 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:09:32.861317 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.861906 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.861906 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:09:32.862467 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:09:32.862467 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.864537 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:09:32.865637 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:09:32.866172 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.866681 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:09:32.866681 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:09:32.866681 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:09:32.868229 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.869252 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:09:32.869252 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:09:32.870724 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.870724 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:09:32.872253 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694CB4B60>]}
[0m06:09:32.872253 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m06:09:32.873265 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:09:32.873265 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:09:32.873265 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:09:32.874264 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:09:32.874264 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:09:32.876946 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:09:32.878190 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:09:32.881117 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:09:32.881117 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:09:32.882215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:09:32.882215 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.882732 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.882732 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:09:32.882732 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:09:32.883737 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.884736 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:09:32.885339 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:09:32.885339 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:09:32.886368 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m06:09:32.886368 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:09:32.886368 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:09:32.886368 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:09:32.887874 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:09:32.888563 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:09:32.891898 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:09:32.892423 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:09:32.894898 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:09:32.895423 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:09:32.896028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:09:32.896028 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.896616 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.896616 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:09:32.897198 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:32.898575 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:32.900104 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:09:32.901107 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:09:32.901107 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:09:32.901107 [error] [Thread-1 (]: 73 of 97 FAIL 1 relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[31mFAIL 1[0m in 0.01s]
[0m06:09:32.901107 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:09:32.902611 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:09:32.902611 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0' to be skipped because of status 'fail'.  Reason: Got 1 result, configured to fail if != 0.
[0m06:09:32.902611 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:09:32.902611 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:09:32.902611 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:09:32.906874 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:09:32.906874 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:09:32.909898 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:09:32.910440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:09:32.910944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:09:32.910944 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.910944 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.911947 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:09:32.911947 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:09:32.913486 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.914632 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:09:32.915805 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:09:32.915805 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:09:32.915805 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.01s]
[0m06:09:32.916817 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:09:32.917359 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:09:32.917359 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:09:32.917955 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:09:32.917955 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:09:32.920598 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:09:32.922103 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:09:32.923107 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:09:32.924126 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:09:32.924126 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:09:32.925108 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.925108 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.925108 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:09:32.925108 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:09:32.926727 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.927930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:09:32.927930 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:09:32.927930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:09:32.927930 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:09:32.929591 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:09:32.929591 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:09:32.929591 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:09:32.929591 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:09:32.931339 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:09:32.934876 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:09:32.935384 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:09:32.938543 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:09:32.939566 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:09:32.939566 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:09:32.939566 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.939566 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.940873 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:09:32.940873 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:32.943491 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:32.943491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:09:32.944992 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:09:32.945516 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:09:32.946061 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.02s]
[0m06:09:32.946061 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:09:32.946750 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:09:32.947357 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:09:32.947357 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:09:32.947915 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:09:32.951171 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:09:32.952687 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:09:32.954389 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:09:32.954389 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:09:32.954389 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:09:32.954389 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.956487 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.956487 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:09:32.956487 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:09:32.957492 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:32.958512 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:09:32.958512 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:09:32.960125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:09:32.960726 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:09:32.960726 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:09:32.961418 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:09:32.961418 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:09:32.961418 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:09:32.962442 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:09:32.964631 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:09:32.965781 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:09:32.968010 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:09:32.968010 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:09:32.969020 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:09:32.969020 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.969527 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.969527 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:09:32.969527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:09:32.970546 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.970546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:09:32.972069 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:09:32.972069 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:09:32.973100 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:09:32.973586 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:09:32.973586 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:09:32.974593 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:09:32.974593 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:09:32.975617 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:09:32.978303 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:09:32.979854 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:09:32.980860 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:09:32.982533 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:09:32.982533 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:09:32.982533 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.983573 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.983573 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:09:32.983573 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:32.986690 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:32.987690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:09:32.988193 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:09:32.988193 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:09:32.988193 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m06:09:32.988193 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:09:32.989823 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:09:32.989823 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:09:32.990872 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:09:32.990872 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:09:32.993434 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:09:32.994463 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:09:32.995985 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:09:32.996705 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:09:32.997348 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:09:32.997348 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:32.997903 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:32.997903 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:09:32.998501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:09:32.999504 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:33.000539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:09:33.001570 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:09:33.001570 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:09:33.001570 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:09:33.001570 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:09:33.003074 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:09:33.003074 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:09:33.004078 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:09:33.004078 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:09:33.007139 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:09:33.007139 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:09:33.010820 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:09:33.011971 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:09:33.012477 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:09:33.012477 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:33.012477 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:33.013481 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:09:33.013481 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:09:40.249910 [debug] [Thread-1 (]: SQL status: OK in 7.236 seconds
[0m06:09:40.251928 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:09:40.252926 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:09:40.253431 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:40.253936 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:09:40.253936 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:09:40.253936 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:09:40.396036 [debug] [Thread-1 (]: SQL status: OK in 0.141 seconds
[0m06:09:40.397841 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:09:40.398495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:09:40.398495 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:40.399517 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:09:40.400120 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186947AA930>]}
[0m06:09:40.400120 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 7.40s]
[0m06:09:40.401131 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:09:40.401131 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:09:40.402131 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:09:40.402634 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:09:40.402634 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:09:40.404174 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:09:40.405775 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:09:40.408673 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:09:40.409691 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:09:40.409691 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:09:40.409691 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:40.409691 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:40.410963 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:09:40.410963 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:09:40.548231 [debug] [Thread-1 (]: SQL status: OK in 0.137 seconds
[0m06:09:40.550588 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:09:40.551594 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:09:40.551594 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:40.553123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:09:40.553123 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:09:40.553123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:09:40.558527 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:09:40.560083 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:09:40.560083 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:09:40.561122 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:40.561970 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:09:40.561970 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694D8D850>]}
[0m06:09:40.561970 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.16s]
[0m06:09:40.563256 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:09:40.563947 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:09:40.563947 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:09:40.564502 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:09:40.564502 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:09:40.567757 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:09:40.569179 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:09:40.571269 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:09:40.572268 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:09:40.572268 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:09:40.572268 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:40.573622 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:40.573622 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:09:40.573622 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:09:52.487161 [debug] [Thread-1 (]: SQL status: OK in 11.913 seconds
[0m06:09:52.490219 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:09:52.490873 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:09:52.492222 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:52.493345 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:09:52.493848 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:09:52.493848 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:09:52.528291 [debug] [Thread-1 (]: SQL status: OK in 0.035 seconds
[0m06:09:52.530840 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:09:52.530840 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:09:52.531873 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:52.532963 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:09:52.532963 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186B38C6A20>]}
[0m06:09:52.533963 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 11.97s]
[0m06:09:52.533963 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:09:52.534949 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:09:52.535541 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:09:52.535541 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:09:52.535541 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:09:52.539106 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:09:52.540744 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:09:52.543291 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:09:52.544357 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:09:52.544357 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:09:52.544357 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:52.544357 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:52.546291 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:09:52.546291 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:09:52.759142 [debug] [Thread-1 (]: SQL status: OK in 0.213 seconds
[0m06:09:52.761766 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:09:52.761766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:09:52.762770 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:52.763775 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:09:52.763775 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:09:52.763775 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:09:52.772371 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:09:52.773983 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:09:52.774987 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:09:52.774987 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:52.775634 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:09:52.775634 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018694DECD70>]}
[0m06:09:52.777207 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.24s]
[0m06:09:52.778400 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:09:52.778788 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:09:52.778788 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:09:52.779802 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:09:52.779802 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:09:52.782253 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:09:52.783301 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:09:52.785512 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:09:52.786517 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:09:52.787517 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:09:52.787517 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:52.787517 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:52.787517 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:09:52.788867 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:09:53.080945 [debug] [Thread-1 (]: SQL status: OK in 0.292 seconds
[0m06:09:53.083372 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:09:53.083372 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:09:53.083372 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:53.085520 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:09:53.085520 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:09:53.085520 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:09:53.124946 [debug] [Thread-1 (]: SQL status: OK in 0.039 seconds
[0m06:09:53.128236 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:09:53.129829 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:09:53.129829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:53.132084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:09:53.132084 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '18c437c9-a6d3-47c2-811f-bb93a1d9adea', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000186B3955370>]}
[0m06:09:53.133090 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.35s]
[0m06:09:53.134092 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:09:53.134092 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:09:53.134092 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:09:53.135999 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:09:53.136612 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:09:53.141288 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:09:53.142894 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:09:53.146134 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:09:53.147895 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:09:53.148909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:09:53.148909 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.149916 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.149916 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:09:53.150924 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.152434 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.155850 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:09:53.156871 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:09:53.156871 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:09:53.158396 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.02s]
[0m06:09:53.158396 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:09:53.158396 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:09:53.160000 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:09:53.160000 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:09:53.161005 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:09:53.167072 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:09:53.168586 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:09:53.171102 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:09:53.172611 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:09:53.172611 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:09:53.172611 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.174139 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.174139 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:09:53.175150 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.178175 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:53.179688 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:09:53.180697 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:09:53.181203 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:09:53.181203 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m06:09:53.182718 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:09:53.183723 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:09:53.183723 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:09:53.185836 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:09:53.185836 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:09:53.190210 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:09:53.191195 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:09:53.194460 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:09:53.195456 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:09:53.195456 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:09:53.195456 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.196696 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:53.196696 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:09:53.197275 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:09:53.200342 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:09:53.202859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:09:53.205391 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:09:53.205391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:09:53.206400 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m06:09:53.208913 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:09:53.209922 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:09:53.210935 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:09:53.212541 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:09:53.212541 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:09:53.220977 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:09:53.224505 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:09:53.227682 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:09:53.230991 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:09:53.232004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:09:53.233014 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.234012 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.234012 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:09:53.235031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.236077 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.237700 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:09:53.238333 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:09:53.238333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:09:53.240109 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.03s]
[0m06:09:53.240634 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:09:53.241346 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:09:53.241886 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:09:53.242455 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:09:53.242455 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:09:53.246665 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:09:53.248432 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:09:53.253983 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:09:53.253983 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:09:53.255664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:09:53.255664 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.256673 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.256673 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:09:53.257670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.258670 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.260847 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:09:53.262573 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:09:53.263584 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:09:53.264625 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:09:53.265841 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:09:53.266848 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:09:53.267553 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:09:53.269102 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:09:53.269102 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:09:53.275171 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:09:53.276177 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:09:53.279751 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:09:53.281987 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:09:53.283494 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:09:53.283494 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.285004 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.285597 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:09:53.285597 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.286605 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.288030 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:09:53.288721 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:09:53.288721 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:09:53.289753 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.02s]
[0m06:09:53.289753 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:09:53.290955 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:09:53.290955 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:09:53.291962 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:09:53.291962 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:09:53.296113 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:09:53.296685 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:09:53.298467 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:09:53.299491 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:09:53.300154 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:09:53.301162 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.301162 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.302164 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:09:53.302670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.304702 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:09:53.305211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:09:53.306218 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:09:53.307219 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:09:53.307219 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.02s]
[0m06:09:53.308931 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:09:53.308931 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:09:53.309940 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:09:53.309940 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:09:53.310679 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:09:53.314857 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:09:53.316465 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:09:53.318149 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:09:53.319182 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:09:53.319182 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:09:53.320242 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.320242 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.321231 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:09:53.321231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.322227 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.324315 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:09:53.324315 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:09:53.325314 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:09:53.325314 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.02s]
[0m06:09:53.325314 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:09:53.327059 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:09:53.327059 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:09:53.328065 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:09:53.328065 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:09:53.332055 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:09:53.333165 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:09:53.335673 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:09:53.337684 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:09:53.338191 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:09:53.338191 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.338191 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.338191 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:09:53.338191 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.339875 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:53.341387 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:09:53.342393 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:09:53.343909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:09:53.345418 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m06:09:53.347158 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:09:53.348379 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:09:53.348379 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:09:53.350020 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:09:53.351026 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:09:53.358313 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:09:53.359838 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:09:53.361881 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:09:53.363557 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:09:53.364568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:09:53.365077 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.365582 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.365582 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:09:53.365582 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.369905 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:09:53.370922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:09:53.370922 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:09:53.372429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:09:53.373434 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m06:09:53.374433 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:09:53.374433 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:09:53.374433 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:09:53.375433 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:09:53.375433 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:09:53.378377 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:09:53.379890 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:09:53.381925 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:09:53.383944 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:09:53.384932 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:09:53.385439 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.385946 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.385946 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:09:53.386953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.387992 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:09:53.389565 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:09:53.389565 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:09:53.390744 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:09:53.390744 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.02s]
[0m06:09:53.390744 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:09:53.392711 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:09:53.392711 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:09:53.393527 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:09:53.393527 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:09:53.397603 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:09:53.398237 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:09:53.400047 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:09:53.401056 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:09:53.401056 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:09:53.401056 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:09:53.401056 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:53.402105 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:09:53.402613 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:09:53.402613 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:09:53.404377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:09:53.404377 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:09:53.405411 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:09:53.405411 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m06:09:53.406498 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:09:53.408524 [debug] [MainThread]: Using duckdb connection "master"
[0m06:09:53.408524 [debug] [MainThread]: On master: BEGIN
[0m06:09:53.408524 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:09:53.410189 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:09:53.410189 [debug] [MainThread]: On master: COMMIT
[0m06:09:53.410189 [debug] [MainThread]: Using duckdb connection "master"
[0m06:09:53.410189 [debug] [MainThread]: On master: COMMIT
[0m06:09:53.410842 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:09:53.410842 [debug] [MainThread]: On master: Close
[0m06:09:53.410842 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:09:53.410842 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:09:53.411881 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:09:53.411881 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:09:53.411881 [info ] [MainThread]: 
[0m06:09:53.412408 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 26.48 seconds (26.48s).
[0m06:09:53.421158 [debug] [MainThread]: Command end result
[0m06:09:53.451349 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:09:53.454542 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:09:53.462623 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:09:53.462623 [info ] [MainThread]: 
[0m06:09:53.463681 [info ] [MainThread]: [31mCompleted with 10 errors, 0 partial successes, and 0 warnings:[0m
[0m06:09:53.464711 [info ] [MainThread]: 
[0m06:09:53.465479 [error] [MainThread]: [31mFailure in test unique_dim_instituicao_id_instituicao (models\gold\schema.yml)[0m
[0m06:09:53.467011 [error] [MainThread]:   Got 8897 results, configured to fail if != 0
[0m06:09:53.467565 [info ] [MainThread]: 
[0m06:09:53.469829 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\unique_dim_instituicao_id_instituicao.sql
[0m06:09:53.470844 [info ] [MainThread]: 
[0m06:09:53.473505 [error] [MainThread]: [31mFailure in test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.473505 [error] [MainThread]:   Got 408414 results, configured to fail if != 0
[0m06:09:53.474447 [info ] [MainThread]: 
[0m06:09:53.475444 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_balanco_pat_f99122bd5f889fcd8f1b28b64e227cb7.sql
[0m06:09:53.476016 [info ] [MainThread]: 
[0m06:09:53.476016 [error] [MainThread]: [31mFailure in test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.477135 [error] [MainThread]:   Got 158270 results, configured to fail if != 0
[0m06:09:53.477135 [info ] [MainThread]: 
[0m06:09:53.477877 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_capital_pru_dc7c09807e22eeacb03b88bc50c11898.sql
[0m06:09:53.477877 [info ] [MainThread]: 
[0m06:09:53.478923 [error] [MainThread]: [31mFailure in test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.478923 [error] [MainThread]:   Got 71836 results, configured to fail if != 0
[0m06:09:53.479767 [info ] [MainThread]: 
[0m06:09:53.480417 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_carteira_cr_d80151d1e76d6c8de6ceccc7adebe863.sql
[0m06:09:53.480417 [info ] [MainThread]: 
[0m06:09:53.480936 [error] [MainThread]: [31mFailure in test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.481546 [error] [MainThread]:   Got 71836 results, configured to fail if != 0
[0m06:09:53.481546 [info ] [MainThread]: 
[0m06:09:53.482102 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_carteira_cr_b00506d5726bd2130bedc66dca5f83d0.sql
[0m06:09:53.482102 [info ] [MainThread]: 
[0m06:09:53.484212 [error] [MainThread]: [31mFailure in test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.484212 [error] [MainThread]:   Got 408408 results, configured to fail if != 0
[0m06:09:53.485112 [info ] [MainThread]: 
[0m06:09:53.485112 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_demonstraca_db359e0c9415ad5a3f4bbc17154e2e4a.sql
[0m06:09:53.485741 [info ] [MainThread]: 
[0m06:09:53.485741 [error] [MainThread]: [31mFailure in test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.485741 [error] [MainThread]:   Got 5517 results, configured to fail if != 0
[0m06:09:53.485741 [info ] [MainThread]: 
[0m06:09:53.486747 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_movimentaca_f65fe7c26084232074cad8e621697c04.sql
[0m06:09:53.486747 [info ] [MainThread]: 
[0m06:09:53.486747 [error] [MainThread]: [31mFailure in test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.487749 [error] [MainThread]:   Got 71836 results, configured to fail if != 0
[0m06:09:53.488287 [info ] [MainThread]: 
[0m06:09:53.489879 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_operacoes_c_33521a505ad34b09fd04bb9cb908c25d.sql
[0m06:09:53.489879 [info ] [MainThread]: 
[0m06:09:53.489879 [error] [MainThread]: [31mFailure in test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.490885 [error] [MainThread]:   Got 408335 results, configured to fail if != 0
[0m06:09:53.490885 [info ] [MainThread]: 
[0m06:09:53.490885 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_resumo_fina_33b8ef218f06d998e4f59856b293d2fa.sql
[0m06:09:53.490885 [info ] [MainThread]: 
[0m06:09:53.491925 [error] [MainThread]: [31mFailure in test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_ (models\gold\schema.yml)[0m
[0m06:09:53.491925 [error] [MainThread]:   Got 1 result, configured to fail if != 0
[0m06:09:53.492464 [info ] [MainThread]: 
[0m06:09:53.492464 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_dim_instituicao_b5bf1250f8e22e22ed6029d8a9776333.sql
[0m06:09:53.492464 [info ] [MainThread]: 
[0m06:09:53.492464 [info ] [MainThread]: Done. PASS=87 WARN=0 ERROR=10 SKIP=0 NO-OP=0 TOTAL=97
[0m06:09:53.493470 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 21 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:09:53.494534 [debug] [MainThread]: Command `dbt build` failed at 06:09:53.494534 after 28.14 seconds
[0m06:09:53.495157 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001869033F380>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001869260D5B0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001869295E7E0>]}
[0m06:09:53.495157 [debug] [MainThread]: Flushing usage events
[0m06:09:54.275203 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:18:27.667821 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53E71D5E0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53E71E3C0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53E71D640>]}


============================== 06:18:27.674484 | 39cadadc-8c70-4f94-b5b2-af3cbbf816c9 ==============================
[0m06:18:27.674484 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:18:27.676057 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'use_colors': 'True', 'invocation_command': 'dbt build', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:18:27.860763 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53E0A7C50>]}
[0m06:18:27.909908 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53BBD84D0>]}
[0m06:18:27.912569 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:18:28.112888 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:18:28.299164 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 11 files changed.
[0m06:18:28.299164 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m06:18:28.300165 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m06:18:28.300165 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_risco_credito.sql
[0m06:18:28.300165 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_porte.sql
[0m06:18:28.301164 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_produto.sql
[0m06:18:28.301164 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m06:18:28.301164 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m06:18:28.301164 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m06:18:28.301164 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_atividade.sql
[0m06:18:28.301164 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_regiao_credito.sql
[0m06:18:28.302670 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m06:18:28.698564 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_resumo_financeiro' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:18:28.700240 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53EFABC80>]}
[0m06:18:28.851245 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:18:28.864319 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B5408BD490>]}
[0m06:18:28.948303 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:18:28.950324 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:18:29.017144 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B5405A1130>]}
[0m06:18:29.017144 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:18:29.022979 [info ] [MainThread]: 
[0m06:18:29.023986 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:18:29.023986 [info ] [MainThread]: 
[0m06:18:29.024984 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:18:29.031271 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:18:29.108314 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:18:29.108314 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:18:29.108314 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:18:29.757572 [debug] [ThreadPool]: SQL status: OK in 0.648 seconds
[0m06:18:29.760839 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:18:29.761901 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:18:29.762498 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:18:29.770740 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:18:29.772306 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:18:29.772306 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:18:29.774325 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:18:29.775325 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:18:29.776880 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:18:29.777497 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:18:29.778089 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:18:29.778089 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:18:29.778089 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:18:29.779677 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:18:29.780686 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:18:29.781264 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:18:29.781264 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:18:29.782272 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:18:29.786189 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:18:29.792480 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:18:29.793494 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:18:29.794002 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:18:29.795008 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:18:29.795008 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:18:29.795532 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:18:29.827669 [debug] [ThreadPool]: SQL status: OK in 0.032 seconds
[0m06:18:29.828278 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:18:29.831355 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:18:29.831355 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:18:29.832403 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B54047C9E0>]}
[0m06:18:29.833411 [debug] [MainThread]: Using duckdb connection "master"
[0m06:18:29.833411 [debug] [MainThread]: On master: BEGIN
[0m06:18:29.833411 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:18:29.834917 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:18:29.835486 [debug] [MainThread]: On master: COMMIT
[0m06:18:29.835486 [debug] [MainThread]: Using duckdb connection "master"
[0m06:18:29.835486 [debug] [MainThread]: On master: COMMIT
[0m06:18:29.836494 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:18:29.836494 [debug] [MainThread]: On master: Close
[0m06:18:29.844421 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:18:29.845922 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:18:29.846994 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:18:29.847340 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:18:29.868452 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:18:29.870026 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:18:29.900892 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:18:29.902892 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:18:29.903399 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:18:29.903399 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:18:29.904346 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:29.904919 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:18:29.905428 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
    );
  
  
[0m06:18:30.385357 [debug] [Thread-1 (]: SQL status: OK in 0.479 seconds
[0m06:18:30.390710 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:18:30.390710 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:18:30.392360 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:30.401134 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:18:30.401134 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:18:30.402647 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:18:30.429776 [debug] [Thread-1 (]: SQL status: OK in 0.027 seconds
[0m06:18:30.436365 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:18:30.436365 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:18:30.436365 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:30.439530 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:18:30.442267 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53BA2DCA0>]}
[0m06:18:30.443481 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.59s]
[0m06:18:30.445501 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:18:30.446826 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:18:30.448095 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:18:30.451992 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:18:30.454527 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:18:30.461444 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:18:30.463468 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:18:30.469623 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:18:30.470879 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:18:30.471771 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:18:30.471771 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:30.473168 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:30.474197 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:18:30.474197 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:18:30.549230 [debug] [Thread-1 (]: SQL status: OK in 0.074 seconds
[0m06:18:30.553780 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:18:30.553780 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:18:30.555445 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:30.557456 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:18:30.558454 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:18:30.558454 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:18:30.561161 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:30.563586 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:18:30.564594 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:18:30.565652 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:30.567416 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:18:30.567989 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540E70FB0>]}
[0m06:18:30.567989 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.12s]
[0m06:18:30.568998 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:18:30.568998 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:18:30.570089 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:18:30.571087 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:18:30.571087 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:18:30.582336 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:18:30.583861 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:18:30.588351 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:18:30.589795 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:18:30.589795 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:18:30.590811 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:30.591808 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:30.591808 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:18:30.593330 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:18:30.656730 [debug] [Thread-1 (]: SQL status: OK in 0.063 seconds
[0m06:18:30.661815 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:18:30.662394 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:18:30.663492 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:30.665889 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:18:30.666902 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:18:30.667413 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:18:30.669943 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:30.672219 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:18:30.673265 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:18:30.673265 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:30.675283 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:18:30.675283 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540613A10>]}
[0m06:18:30.675283 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m06:18:30.676945 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:18:30.677540 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:18:30.678173 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:18:30.679699 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:18:30.679699 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:18:30.685866 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:18:30.688387 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:18:30.691285 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:18:30.693513 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:18:30.694023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:18:30.695551 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:30.695551 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:30.696909 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:18:30.696909 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:18:31.525585 [debug] [Thread-1 (]: SQL status: OK in 0.828 seconds
[0m06:18:31.532665 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:18:31.533677 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:18:31.533677 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:31.535810 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:18:31.536821 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:18:31.537829 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:18:31.799719 [debug] [Thread-1 (]: SQL status: OK in 0.262 seconds
[0m06:18:31.802402 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:18:31.803801 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:18:31.803801 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:31.807000 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:18:31.807658 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540ED34D0>]}
[0m06:18:31.808838 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 1.13s]
[0m06:18:31.809849 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:18:31.809849 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:18:31.810899 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:18:31.812930 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:18:31.813941 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:18:31.819776 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:18:31.820786 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:18:31.823820 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:18:31.825832 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:18:31.826342 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:18:31.826342 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:31.827853 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:31.828871 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:18:31.828871 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:18:32.065593 [debug] [Thread-1 (]: SQL status: OK in 0.237 seconds
[0m06:18:32.072030 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:18:32.073211 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:18:32.074252 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:32.076784 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:18:32.077329 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:18:32.079693 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:18:32.093461 [debug] [Thread-1 (]: SQL status: OK in 0.014 seconds
[0m06:18:32.096511 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:18:32.097189 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:18:32.098594 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:32.100107 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:18:32.101123 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540E51A30>]}
[0m06:18:32.102121 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.29s]
[0m06:18:32.102121 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:18:32.103630 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:18:32.103630 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:18:32.105183 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:18:32.105183 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:18:32.110541 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:18:32.112440 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:18:32.115731 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:18:32.118356 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:18:32.118979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:18:32.118979 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:32.118979 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:32.119992 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:18:32.119992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:18:32.185236 [debug] [Thread-1 (]: SQL status: OK in 0.064 seconds
[0m06:18:32.188972 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:18:32.189986 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:18:32.191012 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:32.192629 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:18:32.193212 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:18:32.193212 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:18:32.223533 [debug] [Thread-1 (]: SQL status: OK in 0.030 seconds
[0m06:18:32.227596 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:18:32.227596 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:18:32.229619 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:32.231065 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:18:32.231065 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F951B80>]}
[0m06:18:32.232083 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.13s]
[0m06:18:32.233618 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:18:32.233618 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:18:32.235129 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:18:32.235129 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:18:32.236480 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:18:32.242355 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:18:32.242709 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:18:32.248008 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:18:32.248008 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:18:32.249705 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:18:32.249705 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:32.250877 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:32.250877 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:18:32.251894 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:18:32.307107 [debug] [Thread-1 (]: SQL status: OK in 0.056 seconds
[0m06:18:32.310144 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:18:32.310718 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:18:32.311328 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:32.312458 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:18:32.312458 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:18:32.312458 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:18:32.395956 [debug] [Thread-1 (]: SQL status: OK in 0.083 seconds
[0m06:18:32.398412 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:18:32.398412 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:18:32.399501 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:32.400497 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:18:32.400497 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540881CD0>]}
[0m06:18:32.401500 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.17s]
[0m06:18:32.401500 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:18:32.402498 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:18:32.402498 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:18:32.403499 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:18:32.403499 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:18:32.407497 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:18:32.409012 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:18:32.411410 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:18:32.412429 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:18:32.412429 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:18:32.413428 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:32.413428 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:32.414436 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:18:32.414436 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:18:33.100169 [debug] [Thread-1 (]: SQL status: OK in 0.685 seconds
[0m06:18:33.104377 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:18:33.104771 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:18:33.105325 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:33.106335 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:18:33.107335 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:18:33.107335 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:18:33.244641 [debug] [Thread-1 (]: SQL status: OK in 0.137 seconds
[0m06:18:33.247153 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:18:33.247684 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:18:33.248699 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:33.249697 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:18:33.250701 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540DA3C50>]}
[0m06:18:33.251698 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.85s]
[0m06:18:33.252710 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:18:33.252710 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:18:33.252710 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:18:33.253603 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:18:33.254614 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:18:33.259612 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:18:33.260619 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:18:33.266147 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:18:33.267147 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:18:33.268150 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:18:33.268150 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:33.268661 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:33.269673 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:18:33.269673 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:18:33.278071 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:18:33.281062 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:18:33.283123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:18:33.283123 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:33.285641 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:18:33.285641 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:18:33.285641 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:18:33.292659 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:18:33.297334 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:18:33.298458 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:18:33.298978 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:33.299985 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:18:33.300800 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F9692E0>]}
[0m06:18:33.301811 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.05s]
[0m06:18:33.301811 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:18:33.302810 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:18:33.303321 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:18:33.303829 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:18:33.304340 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:18:33.307580 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:18:33.308826 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:18:33.313379 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:18:33.315291 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:18:33.316304 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:18:33.317868 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:33.318872 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:33.320871 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:18:33.320871 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:18:33.361929 [debug] [Thread-1 (]: SQL status: OK in 0.039 seconds
[0m06:18:33.366024 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:18:33.366532 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:18:33.367627 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:33.369177 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:18:33.369683 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:18:33.369683 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:18:33.381271 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:18:33.383806 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:18:33.383806 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:18:33.385311 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:33.387886 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:18:33.388456 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540587740>]}
[0m06:18:33.389466 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.08s]
[0m06:18:33.390507 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:18:33.391015 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:18:33.392071 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:18:33.392815 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:18:33.393390 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:18:33.399960 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:18:33.400971 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:18:33.409296 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:18:33.411843 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:18:33.412351 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:18:33.412351 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:33.413566 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:33.414580 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:18:33.415088 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:18:33.769724 [debug] [Thread-1 (]: SQL status: OK in 0.355 seconds
[0m06:18:33.772659 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:18:33.773678 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:18:33.773678 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:33.775193 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:18:33.775193 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:18:33.775193 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:18:33.972064 [debug] [Thread-1 (]: SQL status: OK in 0.196 seconds
[0m06:18:33.975513 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:18:33.975513 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:18:33.977172 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:33.978370 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:18:33.978370 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F9487A0>]}
[0m06:18:33.979930 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.59s]
[0m06:18:33.980937 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:18:33.982478 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:18:33.982478 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:18:33.983488 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:18:33.983488 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:18:33.983488 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:18:34.013536 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:18:34.013536 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:18:34.013536 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.015322 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.016366 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:18:34.016874 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:18:34.019019 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.033539 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:18:34.035104 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.047113 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m06:18:34.054307 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:18:34.056560 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:18:34.056560 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:18:34.057559 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:18:34.060528 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.061768 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:18:34.061768 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540E72330>]}
[0m06:18:34.062807 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.08s]
[0m06:18:34.063992 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:18:34.064549 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:18:34.065668 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:18:34.066235 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:18:34.066744 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:18:34.067301 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:18:34.072096 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:18:34.072096 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:18:34.073339 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.074355 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.074355 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:18:34.075356 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:18:34.075884 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.077491 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:18:34.078075 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.081147 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.081147 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:18:34.082711 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:18:34.083723 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:18:34.083723 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:18:34.085229 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.085809 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:18:34.086837 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B5405848F0>]}
[0m06:18:34.087836 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.02s]
[0m06:18:34.088357 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:18:34.089926 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:18:34.089926 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:18:34.090955 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:18:34.090955 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:18:34.090955 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:18:34.095110 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:18:34.095657 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:18:34.096268 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.097465 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.098052 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:18:34.098052 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:18:34.099973 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.101978 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:18:34.101978 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.104354 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.105909 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:18:34.106919 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:18:34.108443 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:18:34.108443 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:18:34.110035 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.110035 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:18:34.111039 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F9679E0>]}
[0m06:18:34.111542 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.02s]
[0m06:18:34.111542 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:18:34.112710 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:18:34.113775 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:18:34.113775 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:18:34.114781 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:18:34.114781 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:18:34.119173 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:18:34.119706 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:18:34.119706 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.120700 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.120700 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:18:34.120700 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:18:34.120700 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.123225 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:18:34.123225 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.125742 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.127982 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:18:34.129675 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:18:34.129675 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:18:34.129675 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:18:34.131701 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.132784 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:18:34.132784 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F9BFA70>]}
[0m06:18:34.132784 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.02s]
[0m06:18:34.133813 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:18:34.133813 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:18:34.133813 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:18:34.135318 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:18:34.135318 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:18:34.135934 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:18:34.207235 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:18:34.207235 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:18:34.208867 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.210079 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.210079 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:18:34.210811 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:18:34.210811 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.212556 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:18:34.212881 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.214721 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.214721 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:18:34.215464 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:18:34.215464 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:18:34.217118 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:18:34.218497 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.218497 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:18:34.219518 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F9BFDD0>]}
[0m06:18:34.219518 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.08s]
[0m06:18:34.220746 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:18:34.220746 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:18:34.221254 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:18:34.221254 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:18:34.222305 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:18:34.222305 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:18:34.225412 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:18:34.225412 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:18:34.226026 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.226026 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.226026 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:18:34.226026 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:18:34.227131 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.227873 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:18:34.227873 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.229589 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.230700 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:18:34.232359 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:18:34.232359 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:18:34.232967 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:18:34.234972 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.236054 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:18:34.236664 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F980A70>]}
[0m06:18:34.237596 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.02s]
[0m06:18:34.238103 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:18:34.238103 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:18:34.238103 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:18:34.239725 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:18:34.239725 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:18:34.239725 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:18:34.242451 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:18:34.243683 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:18:34.243683 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.244690 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.244690 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:18:34.244690 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:18:34.244690 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.246306 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:18:34.246306 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.248636 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.249732 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:18:34.251496 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:18:34.251496 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:18:34.251496 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:18:34.253076 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.253076 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:18:34.253076 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540EC2AB0>]}
[0m06:18:34.253076 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.01s]
[0m06:18:34.254591 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:18:34.254591 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:18:34.255711 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:18:34.255711 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:18:34.255711 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:18:34.255711 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:18:34.260172 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:18:34.261331 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:18:34.261331 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.262095 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.262095 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:18:34.262762 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:18:34.263287 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.263898 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:18:34.263898 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.266152 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.267092 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:18:34.269624 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:18:34.269624 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:18:34.270626 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:18:34.272731 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.273801 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:18:34.275312 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540EC2B70>]}
[0m06:18:34.275312 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.02s]
[0m06:18:34.276846 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:18:34.276846 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:18:34.276846 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:18:34.277867 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:18:34.277867 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:18:34.277867 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:18:34.282711 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:18:34.282711 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:18:34.282711 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.284164 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.284164 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:18:34.285178 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:18:34.285832 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.286488 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:18:34.286488 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.288154 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.289679 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:18:34.291197 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:18:34.291780 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:18:34.291780 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:18:34.293524 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.295054 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:18:34.295692 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B54082A420>]}
[0m06:18:34.295692 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.02s]
[0m06:18:34.296308 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:18:34.297213 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:18:34.297722 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:18:34.298246 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:18:34.298246 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:18:34.298246 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:18:34.302887 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:18:34.303931 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:18:34.303931 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.303931 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.303931 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:18:34.303931 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:18:34.305991 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.305991 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:18:34.307124 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:18:34.308633 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.308633 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:18:34.310213 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:18:34.310666 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:18:34.311209 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:18:34.312421 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.314572 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:18:34.315738 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B5407C9D00>]}
[0m06:18:34.315738 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.02s]
[0m06:18:34.318029 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:18:34.318029 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:18:34.319039 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m06:18:34.319039 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:18:34.320116 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:18:34.331215 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:18:34.333447 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:18:34.356150 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:18:34.358668 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:18:34.358668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:18:34.358668 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.360684 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.361201 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:18:34.362227 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.365825 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:18:34.370130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:18:34.371259 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:18:34.372648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:18:34.372648 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.05s]
[0m06:18:34.373659 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:18:34.373659 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:18:34.375168 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:18:34.375504 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:18:34.376581 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:18:34.382293 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:18:34.383455 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:18:34.386717 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:18:34.388327 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:18:34.388327 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:18:34.389695 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.391289 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.391289 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:18:34.392447 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.393966 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.395473 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:18:34.397883 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:18:34.398516 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:18:34.400138 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m06:18:34.401148 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:18:34.402665 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:18:34.404346 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:18:34.405357 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:18:34.405357 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:18:34.412505 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:18:34.414590 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:18:34.421103 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:18:34.422120 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:18:34.423512 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:18:34.424517 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.425533 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.425533 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:18:34.425533 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:18:34.435591 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:18:34.436603 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:18:34.438115 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:18:34.438621 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:18:34.439182 [error] [Thread-1 (]: 24 of 97 FAIL 8897 unique_dim_instituicao_id_instituicao ....................... [[31mFAIL 8897[0m in 0.03s]
[0m06:18:34.439852 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:18:34.441378 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:18:34.442393 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37' to be skipped because of status 'fail'.  Reason: Got 8897 results, configured to fail if != 0.
[0m06:18:34.443413 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:18:34.447171 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:18:34.449630 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:18:34.457522 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:18:34.458520 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:18:34.461734 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:18:34.462779 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:18:34.462779 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:18:34.463925 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.465577 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.467213 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:18:34.467213 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.468305 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.469897 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:18:34.471459 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:18:34.471459 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:18:34.472466 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m06:18:34.474022 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:18:34.475014 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:18:34.475528 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:18:34.475528 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:18:34.475528 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:18:34.481920 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:18:34.482952 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:18:34.490617 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:18:34.492341 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:18:34.492846 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:18:34.493360 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.495375 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.497105 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:18:34.498623 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.507607 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:18:34.511981 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:18:34.513799 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:18:34.514812 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:18:34.517422 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.04s]
[0m06:18:34.518003 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:18:34.518003 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:18:34.520144 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:18:34.521147 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:18:34.522659 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:18:34.533081 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:18:34.535617 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:18:34.540743 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:18:34.542448 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:18:34.543461 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:18:34.543461 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.544482 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.545979 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:18:34.547009 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:18:34.551381 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:18:34.552907 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:18:34.553938 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:18:34.553938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:18:34.553938 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.03s]
[0m06:18:34.555794 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:18:34.555794 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:18:34.555794 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:18:34.555794 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:18:34.555794 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:18:34.561412 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:18:34.562532 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:18:34.565338 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:18:34.566900 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:18:34.566900 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:18:34.566900 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.567936 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.567936 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:18:34.567936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.570207 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.572294 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:18:34.573322 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:18:34.573322 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:18:34.574322 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:18:34.575309 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:18:34.575309 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:18:34.575309 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:18:34.577884 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:18:34.577884 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:18:34.583064 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:18:34.584066 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:18:34.587600 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:18:34.588102 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:18:34.588102 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:18:34.589719 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.590739 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.590739 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:18:34.592426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:18:34.596071 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:18:34.598051 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:18:34.601385 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:18:34.601385 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:18:34.603906 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.03s]
[0m06:18:34.605535 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:18:34.606901 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:18:34.608545 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:18:34.608545 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:18:34.610189 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:18:34.614793 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:18:34.617142 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:18:34.621137 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:18:34.622677 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:18:34.622677 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:18:34.622677 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.623673 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.625180 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:18:34.625180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.627189 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.628200 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:18:34.630804 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:18:34.631307 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:18:34.631307 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:18:34.632311 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:18:34.632311 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:18:34.632311 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:18:34.633366 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:18:34.633366 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:18:34.641964 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:18:34.643529 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:18:34.647552 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:18:34.650839 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:18:34.651820 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:18:34.651820 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.651820 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.652836 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:18:34.652836 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.655723 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.656745 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:18:34.658289 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:18:34.658289 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:18:34.660864 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.03s]
[0m06:18:34.662645 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:18:34.662645 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:18:34.663663 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:18:34.664709 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:18:34.665234 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:18:34.670903 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:18:34.672408 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:18:34.675956 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:18:34.677829 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:18:34.677829 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:18:34.677829 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.678847 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.679942 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:18:34.679942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.685532 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:18:34.688051 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:18:34.688592 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:18:34.689616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:18:34.689616 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:18:34.690970 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:18:34.691992 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:18:34.692515 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:18:34.692515 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:18:34.693527 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:18:34.698064 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:18:34.700004 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:18:34.705610 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:18:34.709128 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:18:34.710136 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:18:34.711659 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.712667 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.715440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:18:34.715440 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.739980 [debug] [Thread-1 (]: SQL status: OK in 0.023 seconds
[0m06:18:34.742574 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:18:34.743578 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:18:34.744600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:18:34.745623 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.05s]
[0m06:18:34.746694 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:18:34.747308 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:18:34.747891 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:18:34.748483 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:18:34.748483 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:18:34.751550 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:18:34.752554 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:18:34.755755 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:18:34.758271 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:18:34.758271 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:18:34.758271 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.758271 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.759945 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:18:34.759945 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.760969 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.762782 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:18:34.764314 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:18:34.764836 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:18:34.765418 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:18:34.765418 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:18:34.766997 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:18:34.768128 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:18:34.769132 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:18:34.769132 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:18:34.773977 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:18:34.774960 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:18:34.779744 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:18:34.781455 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:18:34.781455 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:18:34.782492 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.785561 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:34.786571 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:18:34.787587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.789656 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.790693 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:18:34.793551 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:18:34.795182 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:18:34.797438 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.03s]
[0m06:18:34.800992 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:18:34.802995 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:18:34.804025 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:18:34.806682 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:18:34.807681 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:18:34.819021 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:18:34.820026 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:18:34.822738 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:18:34.823739 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:18:34.825242 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:18:34.825653 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.826247 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.826247 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:18:34.826247 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.832007 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:18:34.834014 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:18:34.835517 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:18:34.836524 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:18:34.837543 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m06:18:34.838637 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:18:34.838637 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:18:34.839651 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:18:34.839651 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:18:34.841428 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:18:34.846926 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:18:34.848499 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:18:34.852576 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:18:34.854761 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:18:34.855772 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:18:34.855772 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.856794 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.856794 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:18:34.858302 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.880023 [debug] [Thread-1 (]: SQL status: OK in 0.021 seconds
[0m06:18:34.881869 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:18:34.882897 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:18:34.882897 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:18:34.883895 [error] [Thread-1 (]: 37 of 97 FAIL 158270 relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 158270[0m in 0.04s]
[0m06:18:34.884880 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:18:34.885744 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:18:34.885744 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c' to be skipped because of status 'fail'.  Reason: Got 158270 results, configured to fail if != 0.
[0m06:18:34.885744 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:18:34.887756 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:18:34.887756 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:18:34.892419 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:18:34.893981 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:18:34.897860 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:18:34.898432 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:18:34.899459 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:18:34.899981 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.899981 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.899981 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:18:34.901009 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.901009 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.904112 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:18:34.905639 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:18:34.907647 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:18:34.908645 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.02s]
[0m06:18:34.908645 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:18:34.908645 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:18:34.910236 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:18:34.910870 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:18:34.911875 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:18:34.917303 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:18:34.919656 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:18:34.922662 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:18:34.923713 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:18:34.923713 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:18:34.923713 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.925219 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.925219 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:18:34.925219 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.926757 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.927969 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:18:34.927969 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:18:34.929578 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:18:34.930585 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:18:34.931090 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:18:34.931493 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:18:34.932499 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:18:34.933525 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:18:34.933525 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:18:34.940122 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:18:34.941378 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:18:34.945795 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:18:34.947161 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:18:34.947712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:18:34.947712 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.948219 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:34.948219 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:18:34.948219 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.953332 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:18:34.953852 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:18:34.955538 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:18:34.956542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:18:34.956542 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:18:34.957594 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:18:34.957594 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:18:34.958592 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:18:34.958592 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:18:34.960293 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:18:34.965581 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:18:34.967155 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:18:34.970235 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:18:34.971209 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:18:34.972227 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:18:34.972227 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:34.972759 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:34.973122 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:18:34.973122 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:34.985032 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m06:18:34.986581 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:18:34.987608 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:18:34.988298 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:18:34.988298 [error] [Thread-1 (]: 41 of 97 FAIL 71836 relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 71836[0m in 0.03s]
[0m06:18:34.989916 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:18:34.989916 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:18:34.990943 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29' to be skipped because of status 'fail'.  Reason: Got 71836 results, configured to fail if != 0.
[0m06:18:34.989916 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:18:34.992042 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:18:34.992042 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:18:34.997500 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:18:34.998116 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:18:35.001838 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:18:35.003368 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:18:35.003875 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:18:35.003875 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.004666 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.004666 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:18:35.006175 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.006175 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.008659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:18:35.010275 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:18:35.010868 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:18:35.011895 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.02s]
[0m06:18:35.012896 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:18:35.013433 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:18:35.013433 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:18:35.014050 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:18:35.014050 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:18:35.017984 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:18:35.019740 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:18:35.022249 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:18:35.022249 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:18:35.022249 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:18:35.023767 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.023767 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.023767 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:18:35.025364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.025364 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.027110 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:18:35.028295 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:18:35.028295 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:18:35.028295 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.01s]
[0m06:18:35.029905 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:18:35.029905 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:18:35.030926 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:18:35.030926 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:18:35.031980 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:18:35.036557 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:18:35.038697 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:18:35.042365 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:18:35.044377 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:18:35.045751 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:18:35.045751 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.048186 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:35.048695 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:18:35.048695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.053839 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:18:35.057390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:18:35.058901 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:18:35.059914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:18:35.060968 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m06:18:35.061597 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:18:35.061597 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:18:35.062603 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:18:35.062603 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:18:35.062603 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:18:35.070109 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:18:35.071092 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:18:35.075315 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:18:35.077045 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:18:35.077444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:18:35.077444 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.078462 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:35.080283 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:18:35.080283 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.100000 [debug] [Thread-1 (]: SQL status: OK in 0.019 seconds
[0m06:18:35.102038 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:18:35.102560 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:18:35.104254 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:18:35.105905 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m06:18:35.106458 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:18:35.106458 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:18:35.106458 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:18:35.107463 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:18:35.108489 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:18:35.113088 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:18:35.114620 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:18:35.117005 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:18:35.118402 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:18:35.118402 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:18:35.120410 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.121415 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:35.122411 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:18:35.123455 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.124452 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.127009 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:18:35.128350 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:18:35.128350 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:18:35.128350 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.02s]
[0m06:18:35.130032 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:18:35.131044 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:18:35.131044 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:18:35.133103 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:18:35.133103 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:18:35.138412 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:18:35.140577 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:18:35.148008 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:18:35.150446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:18:35.151579 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:18:35.152581 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.156056 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:35.157065 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:18:35.157065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.158586 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.161828 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:18:35.163503 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:18:35.164033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:18:35.164554 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.03s]
[0m06:18:35.165566 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:18:35.165566 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:18:35.167899 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:18:35.167899 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:18:35.168903 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:18:35.175504 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:18:35.177066 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:18:35.178335 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:18:35.180968 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:18:35.181653 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:18:35.181653 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.182657 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.182657 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:18:35.183661 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.188235 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:18:35.189871 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:18:35.192071 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:18:35.192706 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:18:35.193718 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:18:35.194188 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:18:35.195254 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:18:35.195805 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:18:35.196566 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:18:35.196566 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:18:35.202562 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:18:35.204205 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:18:35.209901 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:18:35.211795 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:18:35.212100 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:18:35.212674 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.212674 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.214328 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:18:35.214881 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.239827 [debug] [Thread-1 (]: SQL status: OK in 0.025 seconds
[0m06:18:35.241848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:18:35.243559 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:18:35.243559 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:18:35.244593 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.05s]
[0m06:18:35.245566 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:18:35.246164 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:18:35.246700 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:18:35.247785 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:18:35.247785 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:18:35.251061 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:18:35.252043 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:18:35.254063 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:18:35.256767 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:18:35.256767 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:18:35.256767 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.257775 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.258770 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:18:35.258770 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.259280 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.261859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:18:35.263371 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:18:35.263371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:18:35.263893 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:18:35.265015 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:18:35.265015 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:18:35.265667 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:18:35.266676 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:18:35.266676 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:18:35.271059 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:18:35.272567 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:18:35.275623 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:18:35.275623 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:18:35.277237 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:18:35.277237 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.277986 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.278494 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:18:35.278494 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.281074 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.282202 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:18:35.283063 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:18:35.284087 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:18:35.285085 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m06:18:35.285623 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:18:35.286144 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:18:35.286144 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:18:35.286144 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:18:35.287709 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:18:35.294784 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:18:35.296307 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:18:35.301563 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:18:35.304101 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:18:35.304618 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:18:35.305837 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.306863 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.308485 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:18:35.309005 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.311022 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:35.312533 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:18:35.313548 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:18:35.314589 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:18:35.315222 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m06:18:35.315859 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:18:35.315859 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:18:35.315859 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:18:35.315859 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:18:35.315859 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:18:35.325233 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:18:35.327556 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:18:35.329637 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:18:35.331292 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:18:35.332327 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:18:35.332327 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.332327 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.333803 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:18:35.333803 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.340536 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:18:35.343771 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:18:35.345452 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:18:35.346533 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:18:35.347163 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:18:35.348366 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:18:35.348366 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:18:35.348892 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:18:35.349427 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:18:35.349427 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:18:35.352613 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:18:35.354402 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:18:35.357788 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:18:35.358792 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:18:35.360229 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:18:35.360229 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.360561 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.361069 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:18:35.361724 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.363304 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.365005 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:18:35.365605 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:18:35.367193 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:18:35.367775 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:18:35.368685 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:18:35.369345 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:18:35.369345 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:18:35.370353 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:18:35.371354 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:18:35.375606 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:18:35.378310 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:18:35.380562 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:18:35.381178 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:18:35.382186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:18:35.382186 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.382698 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.382698 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:18:35.383704 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.383704 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:35.385768 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:18:35.386796 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:18:35.386796 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:18:35.386796 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m06:18:35.388411 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:18:35.388411 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:18:35.390051 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:18:35.390600 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:18:35.391248 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:18:35.396494 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:18:35.398233 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:18:35.402217 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:18:35.404253 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:18:35.404253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:18:35.404253 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.404979 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.404979 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:18:35.405986 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.408540 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:35.410148 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:18:35.411165 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:18:35.411987 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:18:35.412560 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:18:35.412560 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:18:35.413652 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:18:35.413652 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:18:35.414246 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:18:35.414792 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:18:35.418010 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:18:35.419046 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:18:35.420505 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:18:35.422018 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:18:35.422018 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:18:35.422896 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.423406 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.424428 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:18:35.424428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.436625 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:18:35.438367 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:18:35.438367 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:18:35.438367 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:18:35.439986 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:18:35.439986 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:18:35.441120 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:18:35.441120 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:18:35.441120 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:18:35.442480 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:18:35.445642 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:18:35.446821 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:18:35.448427 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:18:35.448427 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:18:35.449695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:18:35.449695 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.450527 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.450527 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:18:35.450527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.451337 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.452936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:18:35.454665 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:18:35.454665 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:18:35.454665 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:18:35.455744 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:18:35.455744 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:18:35.456861 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:18:35.456861 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:18:35.456861 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:18:35.462653 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:18:35.462653 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:18:35.465461 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:18:35.467077 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:18:35.467077 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:18:35.467077 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.468563 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.468563 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:18:35.468563 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.469618 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.470718 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:18:35.471722 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:18:35.472288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:18:35.472288 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.02s]
[0m06:18:35.473346 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:18:35.473346 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:18:35.473346 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:18:35.474305 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:18:35.474305 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:18:35.478172 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:18:35.480868 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:18:35.482374 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:18:35.483445 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:18:35.483445 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:18:35.483445 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.483445 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.484958 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:18:35.484958 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.488219 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:18:35.489882 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:18:35.491234 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:18:35.491234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:18:35.491977 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:18:35.492494 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:18:35.492494 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:18:35.493520 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:18:35.493520 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:18:35.493520 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:18:35.497032 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:18:35.498054 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:18:35.500540 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:18:35.501069 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:18:35.502544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:18:35.503061 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.504078 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.504611 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:18:35.505668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:35.527407 [debug] [Thread-1 (]: SQL status: OK in 0.021 seconds
[0m06:18:35.528121 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:18:35.529715 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:18:35.529715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:18:35.530826 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m06:18:35.531950 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:18:35.531950 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:18:35.531950 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:18:35.532997 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:18:35.532997 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:18:35.535539 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:18:35.536583 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:18:35.539734 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:18:35.539734 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:18:35.540870 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:18:35.541501 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.541501 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.542334 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:18:35.542334 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:18:35.544255 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.547588 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:18:35.548283 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:18:35.549394 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:35.551024 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:18:35.551024 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:18:35.551024 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:18:35.553970 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.557612 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:18:35.558119 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:18:35.558693 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:35.559749 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:18:35.561021 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540889B50>]}
[0m06:18:35.561770 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.03s]
[0m06:18:35.561770 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:18:35.561770 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:18:35.562782 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:18:35.562782 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:18:35.562782 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:18:35.566650 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:18:35.566650 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:18:35.569568 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:18:35.570584 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:18:35.570584 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:18:35.570584 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:35.572101 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:35.572101 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:18:35.572101 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:18:35.574117 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.578314 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:18:35.578314 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:18:35.579341 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:35.579341 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:18:35.579341 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:18:35.579341 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:18:35.582083 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.585613 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:18:35.586124 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:18:35.587144 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:35.590194 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:18:35.591714 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F96AA80>]}
[0m06:18:36.627730 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:18:36.632083 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.03s]
[0m06:18:36.634101 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:18:36.635095 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:18:36.635603 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:18:36.636616 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:18:36.638127 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:18:36.644030 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:18:36.645538 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:18:36.650354 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:18:36.652363 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:18:36.652363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:18:36.653888 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.653888 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.655541 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:18:36.655541 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:18:36.657070 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.658616 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:18:36.658616 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:18:36.660447 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.661801 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:18:36.662376 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:18:36.662376 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:18:36.664556 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.667040 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:18:36.667040 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:18:36.668086 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.669093 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:18:36.669642 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540E7D160>]}
[0m06:18:36.669642 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:18:36.670638 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:18:36.670638 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:18:36.671639 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:18:36.672147 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:18:36.672147 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:18:36.677678 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:18:36.678186 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:18:36.681151 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:18:36.683679 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:18:36.683679 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:18:36.683679 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.683679 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.685186 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:18:36.685186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:18:36.685803 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.689917 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:18:36.689917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:18:36.690927 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.692705 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:18:36.693246 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:18:36.693246 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:18:36.694095 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.696243 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:18:36.696795 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:18:36.697328 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.699418 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:18:36.699924 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540E7EB40>]}
[0m06:18:36.699924 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m06:18:36.700932 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:18:36.701932 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:18:36.701932 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:18:36.702931 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:18:36.702931 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:18:36.705513 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:18:36.706520 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:18:36.710160 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:18:36.710780 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:18:36.711476 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:18:36.711476 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.711987 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.711987 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:18:36.711987 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:18:36.713514 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.716572 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:18:36.717682 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:18:36.718251 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.719765 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:18:36.720771 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:18:36.720771 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:18:36.723289 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.726176 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:18:36.726176 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:18:36.727300 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.728282 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:18:36.728282 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B540817B30>]}
[0m06:18:36.729935 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.03s]
[0m06:18:36.730496 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:18:36.731129 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:18:36.731129 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:18:36.732137 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:18:36.732137 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:18:36.735413 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:18:36.735413 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:18:36.739747 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:18:36.740790 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:18:36.742370 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:18:36.742370 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.743905 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.743905 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:18:36.745520 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:18:36.746698 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.748392 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:18:36.748392 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:18:36.749412 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.751203 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:18:36.751203 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:18:36.751203 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:18:36.753722 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.755787 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:18:36.755787 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:18:36.756799 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.758796 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:18:36.759808 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B54086CBC0>]}
[0m06:18:36.760838 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.03s]
[0m06:18:36.761850 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:18:36.761850 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:18:36.762356 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:18:36.762901 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:18:36.763450 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:18:36.765820 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:18:36.767334 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:18:36.770572 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:18:36.771938 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:18:36.771938 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:18:36.772304 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.772736 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.772736 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:18:36.772736 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:18:36.773746 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.778127 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:18:36.778127 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:18:36.779681 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.782146 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:18:36.783154 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:18:36.783154 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:18:36.785153 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.787712 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:18:36.787712 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:18:36.788240 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.788240 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:18:36.789831 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F951AF0>]}
[0m06:18:36.790849 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.03s]
[0m06:18:36.790849 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:18:36.790849 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:18:36.792068 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:18:36.793202 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:18:36.793202 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:18:36.795720 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:18:36.796827 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:18:36.799848 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:18:36.801178 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:18:36.801178 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:18:36.801178 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.802189 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.802189 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:18:36.802189 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:18:36.803193 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.806696 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:18:36.806696 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:18:36.808296 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.808803 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:18:36.809479 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:18:36.810020 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:18:36.811582 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.813787 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:18:36.813787 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:18:36.814795 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.815328 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:18:36.815328 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F931D30>]}
[0m06:18:36.815328 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m06:18:36.815328 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:18:36.817405 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:18:36.818116 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:18:36.818116 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:18:36.819125 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:18:36.820694 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:18:36.823326 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:18:36.826127 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:18:36.827113 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:18:36.827622 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:18:36.827622 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.827622 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.828636 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:18:36.828636 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:18:36.829739 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.832014 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:18:36.832014 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:18:36.833121 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.834091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:18:36.834091 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:18:36.834091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:18:36.835609 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.838155 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:18:36.838155 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:18:36.838155 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.839674 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:18:36.840712 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B5408A5010>]}
[0m06:18:36.841256 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m06:18:36.841256 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:18:36.841256 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:18:36.842270 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:18:36.842818 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:18:36.843367 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:18:36.845883 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:18:36.846997 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:18:36.851000 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:18:36.852017 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:18:36.852017 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:18:36.852526 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.852526 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.852526 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:18:36.853304 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:18:36.854830 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.856556 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:18:36.857543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:18:36.858524 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.859069 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:18:36.860079 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:18:36.860686 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:18:36.861823 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.864623 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:18:36.865152 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:18:36.865681 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.866724 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:18:36.867269 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F97D280>]}
[0m06:18:36.867930 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m06:18:36.867930 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:18:36.868937 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:18:36.868937 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:18:36.868937 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:18:36.868937 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:18:36.874140 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:18:36.875143 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:18:36.876929 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:18:36.878228 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:18:36.878228 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:18:36.878228 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.879243 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.879243 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:18:36.879655 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:18:36.880167 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.881208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:18:36.882255 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:18:36.882255 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:18:36.882255 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m06:18:36.883757 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:18:36.883757 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:18:36.884754 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:18:36.885264 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:18:36.885264 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:18:36.889942 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:18:36.891147 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:18:36.893254 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:18:36.893254 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:18:36.894251 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:18:36.894251 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.894251 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.894251 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:18:36.895693 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:36.898476 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:36.900055 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:18:36.900055 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:18:36.901581 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:18:36.901581 [error] [Thread-1 (]: 73 of 97 FAIL 1 relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[31mFAIL 1[0m in 0.02s]
[0m06:18:36.902590 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:18:36.902590 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:18:36.902590 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0' to be skipped because of status 'fail'.  Reason: Got 1 result, configured to fail if != 0.
[0m06:18:36.902590 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:18:36.904353 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:18:36.904353 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:18:36.908451 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:18:36.910033 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:18:36.912048 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:18:36.912560 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:18:36.912560 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:18:36.912560 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.913575 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:36.914086 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:18:36.914086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:18:36.915638 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:36.918222 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:18:36.919751 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:18:36.919751 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:18:36.920756 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m06:18:36.922260 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:18:36.922260 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:18:36.922260 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:18:36.923268 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:18:36.923268 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:18:36.927231 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:18:36.927993 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:18:36.932275 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:18:36.933341 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:18:36.933341 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:18:36.935197 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.935705 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.935705 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:18:36.936817 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:18:36.937865 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.938443 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:18:36.939477 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:18:36.940892 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:18:36.940892 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.02s]
[0m06:18:36.941901 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:18:36.942408 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:18:36.942408 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:18:36.944541 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:18:36.946281 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:18:36.955736 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:18:36.956747 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:18:36.960261 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:18:36.961779 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:18:36.962292 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:18:36.962292 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.962823 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.962823 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:18:36.962823 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:36.965504 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:36.968033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:18:36.970091 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:18:36.970091 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:18:36.971091 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.03s]
[0m06:18:36.972091 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:18:36.972091 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:18:36.973204 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:18:36.974216 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:18:36.974216 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:18:36.978185 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:18:36.979756 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:18:36.982293 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:18:36.983374 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:18:36.983374 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:18:36.983374 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:36.985509 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:36.986523 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:18:36.986523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:18:36.989661 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:36.991008 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:18:36.992613 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:18:36.993161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:18:36.993161 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m06:18:36.994169 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:18:36.994169 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:18:36.995675 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:18:36.995675 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:18:36.996967 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:18:37.002593 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:18:37.004143 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:18:37.006179 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:18:37.006918 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:18:37.007815 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:18:37.007815 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:37.008862 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:37.008862 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:18:37.008862 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:18:37.011839 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:37.013950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:18:37.015496 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:18:37.015496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:18:37.016527 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.02s]
[0m06:18:37.017530 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:18:37.017530 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:18:37.018118 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:18:37.019126 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:18:37.019126 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:18:37.024256 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:18:37.025271 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:18:37.028340 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:18:37.029939 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:18:37.029939 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:18:37.029939 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:37.030947 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:37.030947 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:18:37.030947 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:37.035064 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:18:37.035574 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:18:37.036611 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:18:37.037606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:18:37.038133 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m06:18:37.038133 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:18:37.038133 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:18:37.039716 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:18:37.039716 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:18:37.040726 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:18:37.044510 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:18:37.045510 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:18:37.050978 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:18:37.052856 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:18:37.053539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:18:37.054049 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:37.054860 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:37.054860 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:18:37.055867 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:18:37.056918 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:37.058413 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:18:37.058413 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:18:37.060012 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:18:37.060587 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.02s]
[0m06:18:37.061172 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:18:37.061172 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:18:37.061716 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:18:37.062726 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:18:37.062726 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:18:37.065533 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:18:37.066582 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:18:37.069210 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:18:37.069210 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:18:37.070585 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:18:37.070988 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:37.071996 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:37.072507 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:18:37.073530 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:18:45.040899 [debug] [Thread-1 (]: SQL status: OK in 7.968 seconds
[0m06:18:45.043433 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:18:45.043966 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:18:45.043966 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:45.045488 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:18:45.045488 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:18:45.045488 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:18:45.169053 [debug] [Thread-1 (]: SQL status: OK in 0.123 seconds
[0m06:18:45.171076 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:18:45.171076 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:18:45.172074 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:45.173167 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:18:45.173167 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F9E78C0>]}
[0m06:18:45.173167 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 8.11s]
[0m06:18:45.174151 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:18:45.175150 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:18:45.175655 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:18:45.175655 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:18:45.175655 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:18:45.179270 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:18:45.179784 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:18:45.182257 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:18:45.183287 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:18:45.183287 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:18:45.183287 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:45.183287 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:45.184797 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:18:45.184797 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:18:45.370063 [debug] [Thread-1 (]: SQL status: OK in 0.184 seconds
[0m06:18:45.375084 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:18:45.376093 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:18:45.378645 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:45.380165 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:18:45.380669 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:18:45.380669 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:18:45.390564 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:18:45.393511 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:18:45.393511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:18:45.394532 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:45.395531 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:18:45.395531 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F9D62D0>]}
[0m06:18:45.396697 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.22s]
[0m06:18:45.397866 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:18:45.398641 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:18:45.398641 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:18:45.400183 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:18:45.400183 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:18:45.414128 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:18:45.416236 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:18:45.423146 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:18:45.426638 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:18:45.427868 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:18:45.429538 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:45.431363 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:45.432583 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:18:45.433610 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:18:45.455407 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:18:45.457163 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:18:45.458676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: ROLLBACK
[0m06:18:45.479771 [debug] [Thread-1 (]: Failed to rollback 'model.bacen_ifdata_analytics.fato_carteira_credito_produto'
[0m06:18:45.480778 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:18:45.486591 [debug] [Thread-1 (]: Runtime Error in model fato_carteira_credito_produto (models\gold\fato_carteira_credito_produto.sql)
  Binder Error: Set operations can only apply to expressions with the same number of result columns
[0m06:18:45.488119 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F993590>]}
[0m06:18:45.489801 [error] [Thread-1 (]: 83 of 97 ERROR creating sql table model main.fato_carteira_credito_produto ..... [[31mERROR[0m in 0.09s]
[0m06:18:45.491330 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:18:45.493016 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:18:45.494653 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.fato_carteira_credito_produto' to be skipped because of status 'error'.  Reason: Runtime Error in model fato_carteira_credito_produto (models\gold\fato_carteira_credito_produto.sql)
  Binder Error: Set operations can only apply to expressions with the same number of result columns.
[0m06:18:45.496749 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:18:45.498038 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:18:45.500307 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:18:45.513843 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:18:45.518125 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:18:45.528069 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:18:45.532236 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:18:45.533169 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:18:45.533705 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:45.535223 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:45.535840 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:18:45.535840 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:18:45.930797 [debug] [Thread-1 (]: SQL status: OK in 0.394 seconds
[0m06:18:45.934965 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:18:45.936121 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:18:45.936121 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:45.938649 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:18:45.939662 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:18:45.941068 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:18:45.952932 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m06:18:45.957038 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:18:45.957038 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:18:45.959065 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:45.961072 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:18:45.962833 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F933EF0>]}
[0m06:18:45.962833 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.46s]
[0m06:18:45.964872 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:18:45.965577 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:18:45.966586 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:18:45.967165 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:18:45.967671 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:18:45.972389 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:18:45.974396 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:18:45.979947 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:18:45.981967 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:18:45.982960 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:18:45.984013 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:45.985497 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:45.986524 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:18:45.988028 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:18:46.429615 [debug] [Thread-1 (]: SQL status: OK in 0.441 seconds
[0m06:18:46.433946 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:18:46.434943 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:18:46.435474 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:46.435981 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:18:46.437595 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:18:46.437595 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:18:46.501471 [debug] [Thread-1 (]: SQL status: OK in 0.063 seconds
[0m06:18:46.504551 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:18:46.505556 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:18:46.505876 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:46.506563 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:18:46.506563 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '39cadadc-8c70-4f94-b5b2-af3cbbf816c9', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B55F9E63C0>]}
[0m06:18:46.507563 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.54s]
[0m06:18:46.508603 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:18:46.508603 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:18:46.509221 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:18:46.509725 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:18:46.509725 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:18:46.512966 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:18:46.514093 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:18:46.515613 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:18:46.516622 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:18:46.516622 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:18:46.516622 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.517629 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:46.517629 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:18:46.518135 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.518135 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.520284 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:18:46.520284 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:18:46.521279 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:18:46.521279 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:18:46.522248 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:18:46.522248 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:18:46.522248 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:18:46.523304 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:18:46.523304 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:18:46.528509 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:18:46.531236 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:18:46.533246 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:18:46.534808 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:18:46.534808 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:18:46.534808 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.535815 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:46.536153 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:18:46.536153 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.538536 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:46.539039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:18:46.540544 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:18:46.540544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:18:46.541328 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m06:18:46.542151 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:18:46.542791 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:18:46.543382 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:18:46.543936 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:18:46.543936 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:18:46.547618 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:18:46.548136 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:18:46.549829 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:18:46.550838 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:18:46.551832 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:18:46.551832 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.551832 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:46.552832 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:18:46.553334 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:18:46.554845 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.556374 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:18:46.557655 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:18:46.558179 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:18:46.558179 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m06:18:46.559527 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:18:46.559527 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:18:46.560036 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:18:46.560640 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:18:46.560640 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:18:46.564078 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:18:46.564600 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:18:46.566902 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:18:46.568975 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:18:46.568975 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:18:46.568975 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.570137 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.570137 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:18:46.571156 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.571156 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:46.573008 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:18:46.573511 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:18:46.573511 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:18:46.574516 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:18:46.575515 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:18:46.575515 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:18:46.576018 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:18:46.576018 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:18:46.576018 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:18:46.581408 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:18:46.581930 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:18:46.584962 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:18:46.585489 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:18:46.586502 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:18:46.586502 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.586502 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.587501 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:18:46.587501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.588535 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:46.589572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:18:46.591086 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:18:46.591086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:18:46.592094 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:18:46.593611 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:18:46.593611 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:18:46.593611 [info ] [Thread-1 (]: 91 of 97 SKIP test not_null_fato_carteira_credito_produto_id_data .............. [[33mSKIP[0m]
[0m06:18:46.593611 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:18:46.593611 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:18:46.595073 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5' to be skipped because of status 'skipped'. 
[0m06:18:46.595073 [info ] [Thread-1 (]: 92 of 97 SKIP test not_null_fato_carteira_credito_produto_id_instituicao ....... [[33mSKIP[0m]
[0m06:18:46.596034 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:18:46.596552 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:18:46.596552 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d' to be skipped because of status 'skipped'. 
[0m06:18:46.596552 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:18:46.597497 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:18:46.598044 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:18:46.603403 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:18:46.604599 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:18:46.606618 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:18:46.607600 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:18:46.607600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:18:46.607600 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.608601 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.608601 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:18:46.608601 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.610256 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.610839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:18:46.611842 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:18:46.612462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:18:46.612462 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.01s]
[0m06:18:46.612462 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:18:46.612462 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:18:46.614257 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:18:46.614257 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:18:46.615557 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:18:46.619486 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:18:46.620015 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:18:46.622027 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:18:46.623554 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:18:46.623554 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:18:46.623554 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.625062 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.626071 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:18:46.626071 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.627403 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.627926 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:18:46.628939 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:18:46.628939 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:18:46.629954 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m06:18:46.629954 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:18:46.629954 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:18:46.629954 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:18:46.631429 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:18:46.632126 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:18:46.636277 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:18:46.637283 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:18:46.639045 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:18:46.640835 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:18:46.640835 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:18:46.641840 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.642318 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.642822 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:18:46.642822 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.645636 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:18:46.647006 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:18:46.648514 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:18:46.649517 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:18:46.650122 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m06:18:46.651509 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:18:46.652524 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:18:46.652524 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:18:46.654511 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:18:46.654511 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:18:46.658682 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:18:46.659798 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:18:46.662667 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:18:46.665189 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:18:46.665764 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:18:46.665764 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.666269 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.666269 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:18:46.667275 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.667861 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:18:46.669023 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:18:46.669023 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:18:46.670030 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:18:46.670030 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.02s]
[0m06:18:46.671029 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:18:46.671029 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:18:46.672030 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:18:46.672030 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:18:46.672030 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:18:46.675728 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:18:46.677341 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:18:46.678687 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:18:46.680195 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:18:46.680195 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:18:46.680195 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:18:46.681560 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.682653 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:18:46.682653 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:18:46.684231 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:18:46.685232 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:18:46.685738 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:18:46.685738 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:18:46.686745 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m06:18:46.686745 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:18:46.688408 [debug] [MainThread]: Using duckdb connection "master"
[0m06:18:46.688913 [debug] [MainThread]: On master: BEGIN
[0m06:18:46.688913 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:18:46.689921 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:18:46.689921 [debug] [MainThread]: On master: COMMIT
[0m06:18:46.689921 [debug] [MainThread]: Using duckdb connection "master"
[0m06:18:46.690426 [debug] [MainThread]: On master: COMMIT
[0m06:18:46.690426 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:18:46.691021 [debug] [MainThread]: On master: Close
[0m06:18:46.691021 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:18:46.691021 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:18:46.691021 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:18:46.691021 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:18:46.692027 [info ] [MainThread]: 
[0m06:18:46.692530 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 17.67 seconds (17.67s).
[0m06:18:46.701146 [debug] [MainThread]: Command end result
[0m06:18:46.733531 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:18:46.736043 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:18:46.742196 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:18:46.743196 [info ] [MainThread]: 
[0m06:18:46.743196 [info ] [MainThread]: [31mCompleted with 5 errors, 0 partial successes, and 0 warnings:[0m
[0m06:18:46.744197 [info ] [MainThread]: 
[0m06:18:46.744197 [error] [MainThread]: [31mFailure in test unique_dim_instituicao_id_instituicao (models\gold\schema.yml)[0m
[0m06:18:46.744197 [error] [MainThread]:   Got 8897 results, configured to fail if != 0
[0m06:18:46.745962 [info ] [MainThread]: 
[0m06:18:46.745962 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\unique_dim_instituicao_id_instituicao.sql
[0m06:18:46.746635 [info ] [MainThread]: 
[0m06:18:46.747274 [error] [MainThread]: [31mFailure in test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:18:46.747889 [error] [MainThread]:   Got 158270 results, configured to fail if != 0
[0m06:18:46.748446 [info ] [MainThread]: 
[0m06:18:46.749477 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_capital_pru_dc7c09807e22eeacb03b88bc50c11898.sql
[0m06:18:46.750482 [info ] [MainThread]: 
[0m06:18:46.751676 [error] [MainThread]: [31mFailure in test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:18:46.752675 [error] [MainThread]:   Got 71836 results, configured to fail if != 0
[0m06:18:46.752675 [info ] [MainThread]: 
[0m06:18:46.753177 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_carteira_cr_d80151d1e76d6c8de6ceccc7adebe863.sql
[0m06:18:46.754179 [info ] [MainThread]: 
[0m06:18:46.754179 [error] [MainThread]: [31mFailure in test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_ (models\gold\schema.yml)[0m
[0m06:18:46.754179 [error] [MainThread]:   Got 1 result, configured to fail if != 0
[0m06:18:46.755731 [info ] [MainThread]: 
[0m06:18:46.755731 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_dim_instituicao_b5bf1250f8e22e22ed6029d8a9776333.sql
[0m06:18:46.756737 [info ] [MainThread]: 
[0m06:18:46.756737 [error] [MainThread]: [31mFailure in model fato_carteira_credito_produto (models\gold\fato_carteira_credito_produto.sql)[0m
[0m06:18:46.758246 [error] [MainThread]:   Runtime Error in model fato_carteira_credito_produto (models\gold\fato_carteira_credito_produto.sql)
  Binder Error: Set operations can only apply to expressions with the same number of result columns
[0m06:18:46.758246 [info ] [MainThread]: 
[0m06:18:46.759856 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\fato_carteira_credito_produto.sql
[0m06:18:46.760191 [info ] [MainThread]: 
[0m06:18:46.760860 [info ] [MainThread]: Done. PASS=90 WARN=0 ERROR=5 SKIP=2 NO-OP=0 TOTAL=97
[0m06:18:46.760860 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 13 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:18:46.762254 [debug] [MainThread]: Command `dbt build` failed at 06:18:46.762254 after 19.21 seconds
[0m06:18:46.762847 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53E85F320>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B53E5FECF0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001B5406D6AB0>]}
[0m06:18:46.762847 [debug] [MainThread]: Flushing usage events
[0m06:18:47.527357 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:20:25.118446 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F68291940>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6B50A360>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6B50BE30>]}


============================== 06:20:25.125751 | caf7f73e-693c-4f2c-9ba8-fccd221f20b2 ==============================
[0m06:20:25.125751 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:20:25.125751 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'indirect_selection': 'eager', 'invocation_command': 'dbt build', 'use_colors': 'True', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:20:25.329542 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6A92A8D0>]}
[0m06:20:25.381986 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6AE8F440>]}
[0m06:20:25.385652 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:20:25.592446 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:20:25.743734 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed.
[0m06:20:25.744303 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_produto.sql
[0m06:20:26.127644 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:20:26.141357 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D1B2390>]}
[0m06:20:26.285507 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:20:26.288369 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:20:26.386080 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D193EF0>]}
[0m06:20:26.386080 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:20:26.403360 [info ] [MainThread]: 
[0m06:20:26.404376 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:20:26.406131 [info ] [MainThread]: 
[0m06:20:26.407131 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:20:26.427269 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:20:26.543487 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:20:26.543487 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:20:26.544589 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:20:26.660732 [debug] [ThreadPool]: SQL status: OK in 0.116 seconds
[0m06:20:26.662250 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:20:26.662758 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:20:26.663768 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:20:26.672390 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:20:26.673399 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:20:26.673399 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:20:26.674479 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:20:26.675906 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:20:26.676914 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:20:26.677615 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:20:26.677925 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:20:26.677925 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:20:26.678561 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:20:26.679592 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:20:26.680099 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:20:26.680604 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:20:26.680604 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:20:26.681427 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:20:26.683710 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:20:26.689435 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:20:26.689435 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:20:26.689435 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:20:26.691038 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:20:26.691038 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:20:26.691038 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:20:26.710411 [debug] [ThreadPool]: SQL status: OK in 0.018 seconds
[0m06:20:26.712115 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:20:26.712589 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:20:26.713595 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:20:26.714605 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6CDD8260>]}
[0m06:20:26.714605 [debug] [MainThread]: Using duckdb connection "master"
[0m06:20:26.714605 [debug] [MainThread]: On master: BEGIN
[0m06:20:26.715612 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:20:26.715612 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:20:26.716115 [debug] [MainThread]: On master: COMMIT
[0m06:20:26.716745 [debug] [MainThread]: Using duckdb connection "master"
[0m06:20:26.716745 [debug] [MainThread]: On master: COMMIT
[0m06:20:26.717836 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:20:26.717836 [debug] [MainThread]: On master: Close
[0m06:20:26.723212 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:20:26.723212 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:20:26.724209 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:20:26.724209 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:20:26.746522 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:20:26.747049 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:20:26.788309 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:20:26.789928 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:20:26.790957 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:20:26.790957 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:20:26.792802 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:26.793409 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:20:26.794438 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

SELECT
    
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    codigo_origem,
    nome,
    tipo_instituicao,
    md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
    md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
    md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
    nome_conglomerado
FROM unificacao
    );
  
  
[0m06:20:27.278338 [debug] [Thread-1 (]: SQL status: OK in 0.482 seconds
[0m06:20:27.283449 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:20:27.283449 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:20:27.283449 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:27.293469 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:20:27.293469 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:20:27.293469 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:20:27.322572 [debug] [Thread-1 (]: SQL status: OK in 0.029 seconds
[0m06:20:27.330063 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:20:27.330600 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:20:27.331235 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:27.333789 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:20:27.337985 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D21B0B0>]}
[0m06:20:27.338660 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.61s]
[0m06:20:27.339673 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:20:27.339673 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:20:27.341108 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:20:27.342113 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:20:27.342634 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:20:27.346946 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:20:27.348061 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:20:27.352904 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:20:27.353916 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:20:27.353916 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:20:27.353916 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:27.355488 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:27.355488 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:20:27.355488 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:20:27.424935 [debug] [Thread-1 (]: SQL status: OK in 0.068 seconds
[0m06:20:27.427142 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:20:27.427142 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:20:27.428158 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:27.428663 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:20:27.428663 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:20:27.429666 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:20:27.432215 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:27.434228 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:20:27.435251 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:20:27.435776 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:27.436806 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:20:27.436806 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D701D30>]}
[0m06:20:27.437789 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.09s]
[0m06:20:27.438383 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:20:27.438383 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:20:27.439387 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:20:27.439387 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:20:27.439387 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:20:27.448228 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:20:27.448734 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:20:27.451404 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:20:27.453385 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:20:27.453385 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:20:27.453385 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:27.454726 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:27.454726 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:20:27.455735 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:20:27.529502 [debug] [Thread-1 (]: SQL status: OK in 0.072 seconds
[0m06:20:27.531712 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:20:27.532721 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:20:27.533759 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:27.535267 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:20:27.535918 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:20:27.535918 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:20:27.537953 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:27.540174 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:20:27.540174 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:20:27.540861 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:27.541866 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:20:27.541866 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F4050A0>]}
[0m06:20:27.542933 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m06:20:27.543439 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:20:27.544461 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:20:27.544461 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:20:27.545460 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:20:27.545983 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:20:27.553944 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:20:27.555501 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:20:27.558589 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:20:27.560955 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:20:27.561990 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:20:27.562503 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:27.563576 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:27.564601 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:20:27.566020 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:20:28.172734 [debug] [Thread-1 (]: SQL status: OK in 0.606 seconds
[0m06:20:28.175324 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:20:28.176350 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:20:28.176855 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:28.178071 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:20:28.178071 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:20:28.178405 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:20:28.369096 [debug] [Thread-1 (]: SQL status: OK in 0.191 seconds
[0m06:20:28.370640 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:20:28.370640 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:20:28.372150 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:28.373158 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:20:28.374158 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D61A8A0>]}
[0m06:20:28.374158 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.83s]
[0m06:20:28.375157 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:20:28.375157 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:20:28.376242 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:20:28.376746 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:20:28.376746 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:20:28.380189 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:20:28.380849 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:20:28.383383 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:20:28.384367 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:20:28.384367 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:20:28.384367 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:28.385366 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:28.385766 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:20:28.385766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:20:28.553156 [debug] [Thread-1 (]: SQL status: OK in 0.167 seconds
[0m06:20:28.555629 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:20:28.556248 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:20:28.557314 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:28.557314 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:20:28.557314 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:20:28.557314 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:20:28.568062 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:20:28.570462 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:20:28.570462 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:20:28.570462 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:28.572738 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:20:28.573255 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F430A70>]}
[0m06:20:28.573255 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.20s]
[0m06:20:28.574272 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:20:28.574272 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:20:28.575965 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:20:28.576972 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:20:28.576972 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:20:28.581196 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:20:28.582261 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:20:28.584980 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:20:28.584980 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:20:28.586233 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:20:28.586233 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:28.587615 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:28.588084 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:20:28.588084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:20:28.628193 [debug] [Thread-1 (]: SQL status: OK in 0.040 seconds
[0m06:20:28.629904 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:20:28.631019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:20:28.632163 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:28.632163 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:20:28.633441 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:20:28.633441 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:20:28.655804 [debug] [Thread-1 (]: SQL status: OK in 0.022 seconds
[0m06:20:28.656810 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:20:28.658315 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:20:28.658315 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:28.660337 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:20:28.660734 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D716BD0>]}
[0m06:20:28.661264 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.08s]
[0m06:20:28.661937 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:20:28.662540 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:20:28.662540 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:20:28.663563 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:20:28.663563 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:20:28.668044 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:20:28.669050 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:20:28.671060 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:20:28.672624 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:20:28.673626 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:20:28.673626 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:28.673626 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:28.673626 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:20:28.675487 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:20:28.723120 [debug] [Thread-1 (]: SQL status: OK in 0.048 seconds
[0m06:20:28.727215 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:20:28.727720 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:20:28.728225 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:28.728225 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:20:28.729878 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:20:28.730193 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:20:28.798058 [debug] [Thread-1 (]: SQL status: OK in 0.068 seconds
[0m06:20:28.799979 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:20:28.799979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:20:28.800988 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:28.801988 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:20:28.801988 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D61F4D0>]}
[0m06:20:28.801988 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.14s]
[0m06:20:28.803096 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:20:28.803096 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:20:28.803096 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:20:28.804112 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:20:28.804112 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:20:28.810309 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:20:28.811799 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:20:28.815867 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:20:28.817012 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:20:28.817012 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:20:28.817012 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:28.818489 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:28.818489 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:20:28.819494 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:20:29.416310 [debug] [Thread-1 (]: SQL status: OK in 0.597 seconds
[0m06:20:29.419234 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:20:29.419850 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:20:29.419850 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:29.420964 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:20:29.420964 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:20:29.420964 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:20:29.551337 [debug] [Thread-1 (]: SQL status: OK in 0.130 seconds
[0m06:20:29.553850 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:20:29.554355 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:20:29.554355 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:29.555865 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:20:29.556366 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F42BD70>]}
[0m06:20:29.556366 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.75s]
[0m06:20:29.557367 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:20:29.557367 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:20:29.557367 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:20:29.558871 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:20:29.558871 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:20:29.561757 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:20:29.562763 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:20:29.565345 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:20:29.566864 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:20:29.566864 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:20:29.566864 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:29.567871 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:29.567871 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:20:29.568350 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:20:29.572366 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:20:29.574373 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:20:29.575373 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:20:29.575878 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:29.576883 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:20:29.576883 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:20:29.577935 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:20:29.581486 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:20:29.583331 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:20:29.583331 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:20:29.583331 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:29.584933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:20:29.585542 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F437140>]}
[0m06:20:29.585542 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.03s]
[0m06:20:29.586550 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:20:29.586550 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:20:29.586550 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:20:29.586550 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:20:29.586550 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:20:29.591715 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:20:29.592862 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:20:29.595279 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:20:29.595791 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:20:29.596803 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:20:29.596803 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:29.597949 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:29.597949 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:20:29.597949 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:20:29.623823 [debug] [Thread-1 (]: SQL status: OK in 0.025 seconds
[0m06:20:29.627584 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:20:29.628436 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:20:29.628436 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:29.630089 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:20:29.630089 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:20:29.630691 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:20:29.636682 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:20:29.638223 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:20:29.639823 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:20:29.639823 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:29.641527 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:20:29.641527 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F497980>]}
[0m06:20:29.642131 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.05s]
[0m06:20:29.642660 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:20:29.642660 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:20:29.643707 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:20:29.643707 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:20:29.643707 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:20:29.648583 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:20:29.649528 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:20:29.651239 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:20:29.653820 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:20:29.654327 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:20:29.654327 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:29.655330 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:29.655330 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:20:29.655330 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:20:29.917972 [debug] [Thread-1 (]: SQL status: OK in 0.262 seconds
[0m06:20:29.922611 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:20:29.922611 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:20:29.923618 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:29.926133 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:20:29.926133 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:20:29.927244 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:20:30.091186 [debug] [Thread-1 (]: SQL status: OK in 0.164 seconds
[0m06:20:30.093186 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:20:30.093186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:20:30.094186 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.094186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:20:30.094186 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F406150>]}
[0m06:20:30.095692 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.45s]
[0m06:20:30.095692 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:20:30.096941 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:20:30.096941 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:20:30.097947 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:20:30.097947 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:20:30.097947 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:20:30.115297 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:20:30.115297 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:20:30.115297 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.117476 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.117476 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:20:30.118195 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:20:30.119200 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.128943 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:20:30.129972 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.133498 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:20:30.137508 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:20:30.139691 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:20:30.139691 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:20:30.139691 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:20:30.141996 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.141996 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:20:30.143002 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F47B6E0>]}
[0m06:20:30.143002 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.05s]
[0m06:20:30.143963 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:20:30.143963 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:20:30.144650 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:20:30.144650 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:20:30.145650 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:20:30.146235 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:20:30.150900 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:20:30.150900 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:20:30.150900 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.151903 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.151903 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:20:30.152901 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:20:30.152901 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.154251 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:20:30.154251 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.156890 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.156890 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:20:30.158397 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:20:30.158397 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:20:30.159404 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:20:30.160932 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.161939 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:20:30.162443 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F4711C0>]}
[0m06:20:30.162443 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.02s]
[0m06:20:30.162443 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:20:30.164184 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:20:30.164698 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:20:30.165286 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:20:30.165832 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:20:30.165832 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:20:30.169405 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:20:30.169405 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:20:30.170411 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.170411 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.170411 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:20:30.171411 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:20:30.171411 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.172412 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:20:30.172917 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.173925 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.175429 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:20:30.177034 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:20:30.177034 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:20:30.177034 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:20:30.178053 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.179597 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:20:30.179597 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F472810>]}
[0m06:20:30.179597 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.01s]
[0m06:20:30.180603 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:20:30.180603 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:20:30.181604 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:20:30.181604 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:20:30.182604 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:20:30.182604 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:20:30.185530 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:20:30.185530 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:20:30.185530 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.186537 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.186537 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:20:30.186537 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:20:30.187538 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.188605 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:20:30.188605 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.189614 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.190621 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:20:30.192954 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:20:30.192954 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:20:30.193524 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:20:30.194030 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.195810 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:20:30.196822 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F4449E0>]}
[0m06:20:30.196822 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.02s]
[0m06:20:30.197816 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:20:30.197816 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:20:30.198757 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:20:30.198757 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:20:30.199816 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:20:30.199816 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:20:30.202833 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:20:30.202833 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:20:30.203841 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.204346 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.204346 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:20:30.204346 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:20:30.204346 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.205351 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:20:30.206358 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.208862 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.209868 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:20:30.210873 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:20:30.211879 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:20:30.211879 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:20:30.212879 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.213909 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:20:30.213909 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F3FFCE0>]}
[0m06:20:30.214877 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.02s]
[0m06:20:30.215653 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:20:30.216160 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:20:30.216797 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:20:30.217405 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:20:30.217405 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:20:30.217405 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:20:30.220646 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:20:30.220646 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:20:30.220646 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.222150 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.222474 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:20:30.222474 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:20:30.223157 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.224157 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:20:30.224157 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.225667 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.227174 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:20:30.228341 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:20:30.228341 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:20:30.229310 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:20:30.230816 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.231344 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:20:30.231344 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D700440>]}
[0m06:20:30.231344 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.01s]
[0m06:20:30.232480 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:20:30.232480 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:20:30.233486 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:20:30.233486 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:20:30.233486 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:20:30.233486 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:20:30.238664 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:20:30.238664 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:20:30.238664 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.239671 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.240176 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:20:30.240176 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:20:30.241052 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.241687 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:20:30.241687 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.244276 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:20:30.245784 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:20:30.246396 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:20:30.247404 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:20:30.247404 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:20:30.248740 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.249250 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:20:30.249250 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F402540>]}
[0m06:20:30.249250 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.02s]
[0m06:20:30.250254 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:20:30.250254 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:20:30.251260 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:20:30.251260 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:20:30.251260 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:20:30.252767 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:20:30.255719 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:20:30.255719 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:20:30.256729 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.256729 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.257724 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:20:30.257724 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:20:30.258726 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.259232 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:20:30.259736 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.261841 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.262397 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:20:30.263428 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:20:30.264409 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:20:30.264409 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:20:30.265434 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.266434 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:20:30.266434 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F4BBE60>]}
[0m06:20:30.267437 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.02s]
[0m06:20:30.268409 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:20:30.269096 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:20:30.269667 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:20:30.269667 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:20:30.270727 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:20:30.270727 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:20:30.275003 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:20:30.275003 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:20:30.275003 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.275727 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.275727 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:20:30.275727 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:20:30.276833 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.278047 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:20:30.278047 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.279667 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.280706 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:20:30.282283 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:20:30.282283 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:20:30.283418 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:20:30.284104 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.285619 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:20:30.285619 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F4B99A0>]}
[0m06:20:30.286647 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.02s]
[0m06:20:30.286647 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:20:30.287645 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:20:30.288155 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:20:30.288155 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:20:30.289205 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:20:30.289205 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:20:30.292941 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:20:30.293585 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:20:30.293585 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.293585 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.294619 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:20:30.294619 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:20:30.294619 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.296138 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:20:30.296486 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:20:30.298047 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.298591 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:20:30.300637 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:20:30.300637 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:20:30.300637 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:20:30.302638 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.302638 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:20:30.303644 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F4BD190>]}
[0m06:20:30.303644 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.02s]
[0m06:20:30.304637 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:20:30.304637 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:20:30.305636 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m06:20:30.306343 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:20:30.307483 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:20:30.318952 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:20:30.319950 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:20:30.346207 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:20:30.350288 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:20:30.352298 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:20:30.354388 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.357443 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:20:30.358958 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:20:30.360979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.364725 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.375033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:20:30.376835 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:20:30.377354 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:20:30.377987 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.07s]
[0m06:20:30.378838 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:20:30.379846 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:20:30.379846 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:20:30.381367 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:20:30.382374 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:20:30.387401 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:20:30.388728 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:20:30.392275 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:20:30.393460 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:20:30.393460 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:20:30.393460 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.394706 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.394706 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:20:30.394706 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.396301 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.398147 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:20:30.399997 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:20:30.399997 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:20:30.401140 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m06:20:30.402652 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:20:30.402952 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:20:30.403965 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:20:30.403965 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:20:30.403965 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:20:30.413929 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:20:30.415452 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:20:30.420181 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:20:30.421180 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:20:30.422189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:20:30.422189 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.422703 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.422703 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:20:30.422703 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:20:30.428358 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:20:30.431009 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:20:30.432627 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:20:30.434138 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:20:30.435149 [error] [Thread-1 (]: 24 of 97 FAIL 8897 unique_dim_instituicao_id_instituicao ....................... [[31mFAIL 8897[0m in 0.03s]
[0m06:20:30.435657 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:20:30.436671 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:20:30.436671 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37' to be skipped because of status 'fail'.  Reason: Got 8897 results, configured to fail if != 0.
[0m06:20:30.438193 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:20:30.440222 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:20:30.440788 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:20:30.448246 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:20:30.449773 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:20:30.451406 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:20:30.452916 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:20:30.453930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:20:30.453930 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.454441 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.455454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:20:30.456510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.458466 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.458466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:20:30.460764 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:20:30.461379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:20:30.462391 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m06:20:30.463471 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:20:30.463471 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:20:30.464556 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:20:30.465817 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:20:30.465817 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:20:30.478339 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:20:30.479348 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:20:30.482687 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:20:30.483696 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:20:30.483696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:20:30.483696 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.485211 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.485810 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:20:30.485810 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.491222 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:20:30.493304 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:20:30.493919 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:20:30.493919 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:20:30.493919 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.03s]
[0m06:20:30.495433 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:20:30.496030 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:20:30.496546 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:20:30.497105 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:20:30.497105 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:20:30.502786 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:20:30.505841 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:20:30.509340 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:20:30.511777 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:20:30.512651 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:20:30.512651 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.515299 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.515877 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:20:30.515877 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:20:30.517960 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.521231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:20:30.522240 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:20:30.522240 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:20:30.523320 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.03s]
[0m06:20:30.524321 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:20:30.525322 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:20:30.525322 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:20:30.525322 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:20:30.525322 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:20:30.529720 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:20:30.530731 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:20:30.532135 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:20:30.534149 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:20:30.535658 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:20:30.536242 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.536970 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.538762 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:20:30.538762 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.539785 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.541888 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:20:30.542457 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:20:30.543468 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:20:30.543981 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:20:30.546074 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:20:30.546820 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:20:30.547395 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:20:30.548406 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:20:30.548406 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:20:30.553306 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:20:30.555330 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:20:30.558595 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:20:30.560833 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:20:30.561849 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:20:30.561849 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.562438 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.562438 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:20:30.562438 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:20:30.565554 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.567181 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:20:30.567768 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:20:30.568381 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:20:30.568933 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m06:20:30.568933 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:20:30.568933 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:20:30.570322 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:20:30.571340 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:20:30.572331 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:20:30.576905 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:20:30.578071 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:20:30.579591 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:20:30.581416 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:20:30.581942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:20:30.581942 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.582871 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.584417 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:20:30.584417 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.587586 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.588740 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:20:30.589754 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:20:30.590805 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:20:30.590805 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:20:30.593469 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:20:30.593469 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:20:30.594717 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:20:30.595736 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:20:30.596270 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:20:30.601378 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:20:30.601378 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:20:30.603906 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:20:30.603906 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:20:30.605893 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:20:30.606927 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.608924 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.608924 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:20:30.609998 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.611028 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.612653 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:20:30.613173 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:20:30.614307 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:20:30.614864 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m06:20:30.615476 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:20:30.616489 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:20:30.617112 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:20:30.618293 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:20:30.618293 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:20:30.624390 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:20:30.627869 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:20:30.636178 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:20:30.640836 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:20:30.642320 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:20:30.642320 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.645135 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.646675 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:20:30.648058 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.657609 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:20:30.662774 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:20:30.664815 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:20:30.665337 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:20:30.667094 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.05s]
[0m06:20:30.668957 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:20:30.669473 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:20:30.670492 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:20:30.671485 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:20:30.672491 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:20:30.680933 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:20:30.681942 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:20:30.684991 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:20:30.686122 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:20:30.686122 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:20:30.687727 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.688915 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.689929 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:20:30.690484 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.717380 [debug] [Thread-1 (]: SQL status: OK in 0.026 seconds
[0m06:20:30.717972 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:20:30.719488 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:20:30.719488 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:20:30.720504 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.05s]
[0m06:20:30.720504 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:20:30.721503 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:20:30.721503 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:20:30.722494 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:20:30.723004 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:20:30.727818 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:20:30.729388 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:20:30.797652 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:20:30.798749 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:20:30.799763 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:20:30.799763 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.800285 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.801305 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:20:30.801305 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.802815 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.804364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:20:30.804364 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:20:30.805379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:20:30.805379 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.08s]
[0m06:20:30.806400 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:20:30.806400 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:20:30.807392 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:20:30.808391 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:20:30.808391 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:20:30.812940 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:20:30.813969 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:20:30.816510 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:20:30.817015 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:20:30.818023 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:20:30.818536 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.819952 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.820565 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:20:30.820565 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.822563 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.823574 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:20:30.826107 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:20:30.826107 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:20:30.827611 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m06:20:30.827913 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:20:30.828650 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:20:30.828650 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:20:30.828650 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:20:30.829658 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:20:30.835804 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:20:30.836827 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:20:30.838319 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:20:30.841246 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:20:30.841246 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:20:30.842255 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.842764 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.842764 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:20:30.842764 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.847912 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:20:30.848493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:20:30.850094 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:20:30.850094 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:20:30.851109 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:20:30.851109 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:20:30.852617 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:20:30.852617 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:20:30.854197 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:20:30.855317 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:20:30.860899 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:20:30.863711 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:20:30.866932 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:20:30.868589 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:20:30.869117 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:20:30.869117 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.870764 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.870764 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:20:30.870764 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.888373 [debug] [Thread-1 (]: SQL status: OK in 0.016 seconds
[0m06:20:30.891160 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:20:30.892173 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:20:30.892679 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:20:30.893293 [error] [Thread-1 (]: 37 of 97 FAIL 158270 relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 158270[0m in 0.04s]
[0m06:20:30.894303 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:20:30.895301 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:20:30.896485 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c' to be skipped because of status 'fail'.  Reason: Got 158270 results, configured to fail if != 0.
[0m06:20:30.897105 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:20:30.897105 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:20:30.898202 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:20:30.902796 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:20:30.904318 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:20:30.908702 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:20:30.909746 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:20:30.911303 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:20:30.911858 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.912458 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.912458 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:20:30.912458 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.913473 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.915425 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:20:30.918135 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:20:30.918135 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:20:30.919164 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.02s]
[0m06:20:30.919674 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:20:30.919674 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:20:30.920698 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:20:30.921307 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:20:30.922935 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:20:30.925449 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:20:30.927108 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:20:30.928272 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:20:30.929784 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:20:30.929784 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:20:30.929784 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.930792 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.930792 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:20:30.931297 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.931297 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.933810 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:20:30.935438 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:20:30.935438 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:20:30.935438 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:20:30.936581 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:20:30.936581 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:20:30.937444 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:20:30.938107 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:20:30.938107 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:20:30.942659 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:20:30.943667 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:20:30.945681 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:20:30.946689 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:20:30.946689 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:20:30.947195 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.947823 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:30.947823 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:20:30.947823 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.950384 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:30.951513 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:20:30.953150 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:20:30.954290 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:20:30.954290 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:20:30.955745 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:20:30.956749 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:20:30.956749 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:20:30.958255 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:20:30.958255 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:20:30.963686 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:20:30.965197 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:20:30.967089 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:20:30.968253 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:20:30.968253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:20:30.969260 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.969766 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.969766 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:20:30.969766 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.975301 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:20:30.978228 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:20:30.978228 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:20:30.978228 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:20:30.978228 [error] [Thread-1 (]: 41 of 97 FAIL 71836 relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 71836[0m in 0.02s]
[0m06:20:30.980908 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:20:30.981411 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:20:30.981411 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29' to be skipped because of status 'fail'.  Reason: Got 71836 results, configured to fail if != 0.
[0m06:20:30.981411 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:20:30.982417 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:20:30.982417 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:20:30.986722 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:20:30.987721 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:20:30.989333 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:20:30.990726 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:20:30.991241 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:20:30.991241 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:30.991918 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.991918 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:20:30.992491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:30.992997 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:30.993728 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:20:30.994735 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:20:30.994735 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:20:30.994735 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m06:20:30.996398 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:20:30.997201 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:20:30.997201 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:20:30.998213 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:20:30.998213 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:20:31.002548 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:20:31.004140 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:20:31.007602 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:20:31.009116 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:20:31.009116 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:20:31.010252 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.010782 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.011289 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:20:31.011289 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.012000 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.014646 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:20:31.016084 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:20:31.016855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:20:31.017676 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.02s]
[0m06:20:31.018290 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:20:31.018290 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:20:31.018290 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:20:31.019600 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:20:31.019600 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:20:31.023123 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:20:31.024319 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:20:31.026882 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:20:31.028014 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:20:31.028014 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:20:31.028518 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.028518 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.029525 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:20:31.029525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.032038 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:31.034042 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:20:31.034042 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:20:31.035060 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:20:31.035060 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:20:31.035584 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:20:31.035584 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:20:31.036605 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:20:31.036605 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:20:31.037613 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:20:31.041276 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:20:31.042281 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:20:31.044120 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:20:31.045650 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:20:31.046262 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:20:31.046262 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.046830 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.047448 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:20:31.047448 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.059371 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:20:31.060373 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:20:31.061545 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:20:31.061545 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:20:31.061545 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:20:31.062550 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:20:31.062550 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:20:31.063681 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:20:31.063681 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:20:31.064686 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:20:31.068050 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:20:31.069073 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:20:31.071399 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:20:31.072399 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:20:31.072399 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:20:31.072906 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.072906 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.073913 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:20:31.073913 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.073913 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.075418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:20:31.077829 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:20:31.077829 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:20:31.079855 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.02s]
[0m06:20:31.082568 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:20:31.083582 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:20:31.083582 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:20:31.085114 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:20:31.085815 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:20:31.088330 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:20:31.088330 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:20:31.092184 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:20:31.093326 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:20:31.093847 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:20:31.093847 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.093847 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.094860 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:20:31.094860 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.095860 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.096937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:20:31.096937 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:20:31.098304 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:20:31.098304 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m06:20:31.098304 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:20:31.100077 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:20:31.100604 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:20:31.100604 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:20:31.100604 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:20:31.106924 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:20:31.107921 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:20:31.110190 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:20:31.111695 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:20:31.111695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:20:31.112702 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.113208 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.113712 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:20:31.113712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.117911 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:20:31.119673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:20:31.120698 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:20:31.120698 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:20:31.120698 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:20:31.122207 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:20:31.122207 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:20:31.122207 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:20:31.123211 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:20:31.123211 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:20:31.127398 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:20:31.128094 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:20:31.130701 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:20:31.131207 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:20:31.131207 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:20:31.132210 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.133572 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.133572 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:20:31.133572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.152546 [debug] [Thread-1 (]: SQL status: OK in 0.018 seconds
[0m06:20:31.152546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:20:31.154368 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:20:31.154368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:20:31.154368 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:20:31.156136 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:20:31.156136 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:20:31.157127 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:20:31.157127 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:20:31.157127 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:20:31.160880 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:20:31.161996 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:20:31.163020 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:20:31.164798 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:20:31.164798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:20:31.165305 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.165752 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.165752 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:20:31.165752 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.167063 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.168375 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:20:31.169048 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:20:31.169048 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:20:31.170095 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m06:20:31.171056 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:20:31.171056 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:20:31.172056 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:20:31.172573 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:20:31.172573 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:20:31.175140 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:20:31.176742 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:20:31.178211 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:20:31.179844 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:20:31.179844 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:20:31.179844 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.180906 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.180906 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:20:31.180906 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.182212 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.183916 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:20:31.184930 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:20:31.184930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:20:31.185953 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m06:20:31.185953 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:20:31.185953 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:20:31.187010 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:20:31.187575 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:20:31.187575 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:20:31.190823 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:20:31.192467 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:20:31.196509 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:20:31.197068 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:20:31.197068 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:20:31.198144 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.198729 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.198729 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:20:31.199779 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.202585 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:31.203092 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:20:31.204108 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:20:31.205108 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:20:31.205108 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:20:31.206107 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:20:31.206107 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:20:31.206880 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:20:31.206880 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:20:31.207711 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:20:31.211925 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:20:31.212718 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:20:31.215937 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:20:31.217745 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:20:31.218299 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:20:31.218870 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.219443 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.219443 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:20:31.220576 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.223254 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:20:31.225307 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:20:31.225307 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:20:31.225307 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:20:31.225307 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:20:31.227086 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:20:31.227086 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:20:31.228148 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:20:31.228148 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:20:31.228148 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:20:31.232216 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:20:31.233337 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:20:31.234880 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:20:31.235688 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:20:31.235688 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:20:31.236704 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.236704 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.237787 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:20:31.237787 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.238521 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.240223 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:20:31.240835 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:20:31.240835 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:20:31.240835 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m06:20:31.242464 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:20:31.242464 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:20:31.242464 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:20:31.243474 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:20:31.244023 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:20:31.247422 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:20:31.247969 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:20:31.250153 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:20:31.251200 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:20:31.251200 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:20:31.251200 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.252710 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.252710 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:20:31.252710 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.254295 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.255305 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:20:31.255305 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:20:31.256668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:20:31.256668 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:20:31.257642 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:20:31.257642 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:20:31.258642 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:20:31.258642 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:20:31.258642 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:20:31.263658 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:20:31.264926 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:20:31.266590 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:20:31.266590 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:20:31.267950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:20:31.267950 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.267950 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.267950 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:20:31.267950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.272221 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:20:31.274252 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:20:31.274252 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:20:31.275247 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:20:31.275247 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:20:31.275247 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:20:31.275247 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:20:31.276852 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:20:31.277574 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:20:31.277574 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:20:31.282941 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:20:31.283926 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:20:31.284913 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:20:31.286194 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:20:31.286194 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:20:31.286194 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.287794 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.288557 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:20:31.288557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.300317 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:20:31.301350 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:20:31.302881 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:20:31.302881 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:20:31.303929 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:20:31.303929 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:20:31.303929 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:20:31.303929 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:20:31.305543 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:20:31.305543 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:20:31.308981 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:20:31.310015 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:20:31.312625 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:20:31.313678 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:20:31.313678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:20:31.314690 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.315201 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.315779 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:20:31.315779 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.316848 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.317415 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:20:31.318751 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:20:31.319762 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:20:31.319762 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:20:31.320760 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:20:31.320760 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:20:31.320760 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:20:31.320760 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:20:31.322266 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:20:31.325128 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:20:31.325671 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:20:31.328164 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:20:31.329804 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:20:31.329804 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:20:31.329804 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.330575 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.331098 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:20:31.331098 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.332208 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.333241 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:20:31.333241 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:20:31.333241 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:20:31.333241 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:20:31.334785 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:20:31.335327 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:20:31.335327 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:20:31.336340 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:20:31.336340 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:20:31.340882 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:20:31.341966 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:20:31.344734 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:20:31.346872 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:20:31.347378 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:20:31.347378 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.348176 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.348176 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:20:31.349185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.352060 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:20:31.353847 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:20:31.354574 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:20:31.354574 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:20:31.354574 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:20:31.354574 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:20:31.356240 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:20:31.356240 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:20:31.357298 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:20:31.357298 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:20:31.361277 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:20:31.362611 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:20:31.364497 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:20:31.365549 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:20:31.365549 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:20:31.365549 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.366801 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.367510 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:20:31.367510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:31.394744 [debug] [Thread-1 (]: SQL status: OK in 0.027 seconds
[0m06:20:31.398130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:20:31.400522 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:20:31.401536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:20:31.401536 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m06:20:31.403048 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:20:31.403048 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:20:31.404056 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:20:31.404056 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:20:31.404056 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:20:31.407194 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:20:31.408699 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:20:31.411055 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:20:31.411717 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:20:31.411717 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:20:31.412729 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.413235 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.413235 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:20:31.413740 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:20:31.414746 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.417604 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:20:31.418158 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:20:31.419189 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.420357 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:20:31.420357 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:20:31.421301 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:20:31.422221 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:31.424994 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:20:31.424994 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:20:31.425569 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.425569 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:20:31.425569 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D70A330>]}
[0m06:20:31.427202 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.02s]
[0m06:20:31.428360 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:20:31.428360 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:20:31.428360 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:20:31.429388 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:20:31.429388 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:20:31.433511 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:20:31.435020 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:20:31.436611 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:20:31.437622 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:20:31.438306 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:20:31.438306 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.438306 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.439322 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:20:31.439322 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:20:31.440071 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.442366 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:20:31.443401 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:20:31.443915 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.444923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:20:31.444923 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:20:31.444923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:20:31.446985 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.448026 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:20:31.449652 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:20:31.449652 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.451338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:20:31.451338 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6CE5A540>]}
[0m06:20:31.451338 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m06:20:31.452854 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:20:31.453861 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:20:31.453861 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:20:31.453861 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:20:31.455462 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:20:31.457489 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:20:31.458469 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:20:31.463717 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:20:31.465342 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:20:31.465342 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:20:31.465342 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:31.465342 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.465342 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:20:31.466766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:20:31.467512 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.469654 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:20:31.469654 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:20:31.469654 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.470649 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:20:31.470649 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:20:31.470649 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:20:31.473165 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:31.475190 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:20:31.475706 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:20:31.475706 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:31.477229 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:20:31.477229 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F1CAB64E0>]}
[0m06:20:32.544890 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:20:32.546869 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.02s]
[0m06:20:32.547883 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:20:32.549872 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:20:32.550548 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:20:32.551327 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:20:32.552856 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:20:32.556530 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:20:32.558590 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:20:32.562008 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:20:32.563012 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:20:32.564034 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:20:32.564395 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.564929 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.565683 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:20:32.565683 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:20:32.566697 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.569829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:20:32.569829 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:20:32.570834 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:32.570834 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:20:32.572338 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:20:32.572338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:20:32.577330 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:20:32.579371 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:20:32.581005 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:20:32.581005 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:32.583036 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:20:32.584018 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6CEBBE90>]}
[0m06:20:32.584018 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m06:20:32.585567 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:20:32.585567 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:20:32.586239 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:20:32.586239 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:20:32.587244 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:20:32.589813 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:20:32.590825 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:20:32.595669 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:20:32.597460 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:20:32.597460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:20:32.597460 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.598881 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.600342 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:20:32.600342 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:20:32.601862 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.604412 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:20:32.605935 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:20:32.606957 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.609104 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:20:32.609104 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:20:32.609104 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:20:32.611548 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.614206 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:20:32.615152 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:20:32.615656 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:32.616677 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:20:32.617255 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D679EE0>]}
[0m06:20:32.618263 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.03s]
[0m06:20:32.618767 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:20:32.618767 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:20:32.619804 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:20:32.619804 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:20:32.619804 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:20:32.622988 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:20:32.623994 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:20:32.627214 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:20:32.627721 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:20:32.628354 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:20:32.628354 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.628969 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.628969 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:20:32.628969 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:20:32.631012 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.635616 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:20:32.635616 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:20:32.637150 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:32.638188 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:20:32.638188 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:20:32.638188 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:20:32.641214 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.648584 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:20:32.650180 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:20:32.651707 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.657235 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:20:32.658754 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F1CA9CB00>]}
[0m06:20:32.660533 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.04s]
[0m06:20:32.661944 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:20:32.663990 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:20:32.667187 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:20:32.668740 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:20:32.669888 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:20:32.678270 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:20:32.682710 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:20:32.693191 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:20:32.694709 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:20:32.695719 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:20:32.696916 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.698256 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:32.698256 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:20:32.699870 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:20:32.700896 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.712507 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:20:32.713521 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:20:32.715360 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.718452 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:20:32.718961 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:20:32.719966 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:20:32.720966 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.725010 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:20:32.725631 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:20:32.727229 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:32.729394 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:20:32.729394 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F48C740>]}
[0m06:20:32.730963 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.06s]
[0m06:20:32.731971 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:20:32.731971 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:20:32.733009 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:20:32.734008 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:20:32.734008 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:20:32.735596 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:20:32.738573 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:20:32.748042 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:20:32.751844 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:20:32.753464 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:20:32.755133 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.756140 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.757150 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:20:32.758663 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:20:32.761405 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:32.766871 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:20:32.768022 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:20:32.769535 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.772055 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:20:32.773067 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:20:32.774064 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:20:32.777086 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.785385 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:20:32.785898 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:20:32.786917 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:32.788408 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:20:32.790666 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D219700>]}
[0m06:20:32.791319 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.06s]
[0m06:20:32.793494 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:20:32.794502 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:20:32.796024 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:20:32.796582 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:20:32.797774 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:20:32.802898 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:20:32.803911 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:20:32.810128 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:20:32.812520 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:20:32.813857 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:20:32.813857 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.815877 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.816884 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:20:32.817881 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:20:32.818772 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.821982 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:20:32.822987 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:20:32.823990 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.825533 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:20:32.825533 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:20:32.827148 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:20:32.828207 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.832557 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:20:32.833551 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:20:32.833551 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:32.836305 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:20:32.837334 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F7F3F1D60>]}
[0m06:20:32.837334 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.04s]
[0m06:20:32.838333 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:20:32.838333 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:20:32.838868 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:20:32.839875 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:20:32.840902 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:20:32.844497 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:20:32.846645 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:20:32.850859 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:20:32.852855 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:20:32.852855 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:20:32.852855 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.853914 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.853914 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:20:32.855746 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:20:32.856768 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.860876 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:20:32.860876 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:20:32.862844 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.864194 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:20:32.864715 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:20:32.864715 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:20:32.865326 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.868071 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:20:32.868071 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:20:32.869189 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:32.870767 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:20:32.872275 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D219FA0>]}
[0m06:20:32.872275 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m06:20:32.873298 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:20:32.874293 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:20:32.874293 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:20:32.875354 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:20:32.875354 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:20:32.880073 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:20:32.881313 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:20:32.883396 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:20:32.883396 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:20:32.883396 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:20:32.884903 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.885508 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.885508 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:20:32.885508 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:20:32.887521 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.889692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:20:32.890819 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:20:32.890819 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:20:32.892459 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.02s]
[0m06:20:32.892459 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:20:32.893470 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:20:32.893470 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:20:32.894642 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:20:32.894642 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:20:32.900514 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:20:32.902535 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:20:32.904832 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:20:32.904832 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:20:32.906254 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:20:32.906254 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.907140 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.907140 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:20:32.907140 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:32.911711 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:20:32.913716 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:20:32.915618 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:20:32.915618 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:20:32.915618 [error] [Thread-1 (]: 73 of 97 FAIL 1 relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[31mFAIL 1[0m in 0.02s]
[0m06:20:32.917151 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:20:32.917151 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:20:32.918318 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0' to be skipped because of status 'fail'.  Reason: Got 1 result, configured to fail if != 0.
[0m06:20:32.917739 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:20:32.918984 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:20:32.919487 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:20:32.925536 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:20:32.925536 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:20:32.928679 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:20:32.930195 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:20:32.931208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:20:32.932592 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.933218 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.934221 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:20:32.935206 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:20:32.939232 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:20:32.941141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:20:32.942148 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:20:32.942148 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:20:32.943611 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m06:20:32.944617 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:20:32.944617 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:20:32.946735 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:20:32.946735 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:20:32.947779 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:20:32.951443 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:20:32.953728 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:20:32.956759 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:20:32.959568 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:20:32.960703 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:20:32.961362 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.961362 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.962914 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:20:32.962914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:20:32.964547 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.965582 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:20:32.966588 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:20:32.967094 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:20:32.968292 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.02s]
[0m06:20:32.969296 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:20:32.969296 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:20:32.971354 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:20:32.972859 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:20:32.973364 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:20:32.979733 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:20:32.981295 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:20:32.983701 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:20:32.985835 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:20:32.986866 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:20:32.987865 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:32.988390 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:32.988390 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:20:32.988390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:32.994626 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:20:32.996147 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:20:32.997876 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:20:32.998466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:20:32.999477 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.03s]
[0m06:20:33.000491 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:20:33.001496 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:20:33.001496 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:20:33.002495 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:20:33.002495 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:20:33.006822 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:20:33.008822 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:20:33.010448 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:20:33.011597 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:20:33.012627 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:20:33.012627 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:33.014073 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:33.014981 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:20:33.015549 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:20:33.017789 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:33.018935 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:20:33.020946 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:20:33.020946 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:20:33.020946 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m06:20:33.022747 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:20:33.023758 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:20:33.025165 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:20:33.027178 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:20:33.027683 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:20:33.033122 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:20:33.034123 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:20:33.036632 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:20:33.038153 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:20:33.038153 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:20:33.038153 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:33.039760 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:33.040780 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:20:33.040780 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:20:33.042469 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:33.043497 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:20:33.044030 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:20:33.044030 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:20:33.045538 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.02s]
[0m06:20:33.047087 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:20:33.047087 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:20:33.048090 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:20:33.048090 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:20:33.048090 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:20:33.058425 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:20:33.060039 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:20:33.063471 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:20:33.064481 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:20:33.065502 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:20:33.066032 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:33.067053 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:33.067053 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:20:33.067792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:33.069953 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:33.070953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:20:33.073314 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:20:33.074322 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:20:33.075301 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.03s]
[0m06:20:33.076914 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:20:33.077425 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:20:33.078014 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:20:33.078014 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:20:33.078014 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:20:33.083256 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:20:33.085784 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:20:33.087799 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:20:33.089949 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:20:33.089949 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:20:33.089949 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:33.090962 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:33.090962 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:20:33.090962 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:20:33.092883 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:33.094064 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:20:33.096575 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:20:33.097168 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:20:33.098357 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.02s]
[0m06:20:33.099369 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:20:33.099369 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:20:33.100496 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:20:33.101029 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:20:33.101029 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:20:33.106775 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:20:33.108844 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:20:33.112616 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:20:33.114172 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:20:33.114695 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:20:33.115000 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:33.115504 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:33.115504 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:20:33.115504 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:20:41.325663 [debug] [Thread-1 (]: SQL status: OK in 8.210 seconds
[0m06:20:41.328899 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:20:41.329951 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:20:41.330559 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:41.332349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:20:41.332349 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:20:41.332349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:20:41.477230 [debug] [Thread-1 (]: SQL status: OK in 0.144 seconds
[0m06:20:41.478291 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:20:41.478291 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:20:41.480553 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:41.481213 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:20:41.482247 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D7474A0>]}
[0m06:20:41.482247 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 8.38s]
[0m06:20:41.482789 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:20:41.482789 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:20:41.483800 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:20:41.483800 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:20:41.483800 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:20:41.487914 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:20:41.488505 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:20:41.492378 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:20:41.493955 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:20:41.493955 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:20:41.493955 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:41.495503 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:41.496072 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:20:41.496072 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:20:41.672821 [debug] [Thread-1 (]: SQL status: OK in 0.176 seconds
[0m06:20:41.673835 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:20:41.673835 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:20:41.675559 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:41.676672 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:20:41.676672 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:20:41.677275 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:20:41.682503 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:20:41.683617 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:20:41.683617 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:20:41.685229 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:41.685984 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:20:41.685984 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F1CAFCEC0>]}
[0m06:20:41.685984 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.20s]
[0m06:20:41.687801 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:20:41.688305 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:20:41.688305 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:20:41.688305 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:20:41.688305 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:20:41.693221 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:20:41.694234 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:20:41.695843 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:20:41.696952 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:20:41.696952 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:20:41.696952 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:41.696952 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:41.698255 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:20:41.698255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:20:53.793318 [debug] [Thread-1 (]: SQL status: OK in 12.095 seconds
[0m06:20:53.795830 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:20:53.796334 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:20:53.796954 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:53.798001 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:20:53.798001 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:20:53.798001 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:20:53.827090 [debug] [Thread-1 (]: SQL status: OK in 0.028 seconds
[0m06:20:53.828170 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:20:53.828170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:20:53.829749 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:53.830759 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:20:53.831265 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F1CAD8590>]}
[0m06:20:53.831265 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 12.14s]
[0m06:20:53.832271 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:20:53.832779 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:20:53.832779 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:20:53.832779 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:20:53.833780 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:20:53.836861 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:20:53.836861 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:20:53.840029 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:20:53.841034 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:20:53.841034 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:20:53.842035 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:53.842539 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:53.842539 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:20:53.842539 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:20:54.053863 [debug] [Thread-1 (]: SQL status: OK in 0.211 seconds
[0m06:20:54.056705 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:20:54.058325 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:20:54.058325 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.058325 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:20:54.058325 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:20:54.060079 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:20:54.070719 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m06:20:54.073229 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:20:54.074227 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:20:54.074227 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.075244 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:20:54.075244 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F1CB2EB70>]}
[0m06:20:54.075244 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.24s]
[0m06:20:54.076948 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:20:54.077515 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:20:54.077515 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:20:54.078213 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:20:54.078213 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:20:54.081877 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:20:54.082885 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:20:54.085501 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:20:54.086545 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:20:54.086545 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:20:54.086545 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.087602 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.087602 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:20:54.088152 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:20:54.389879 [debug] [Thread-1 (]: SQL status: OK in 0.301 seconds
[0m06:20:54.391973 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:20:54.391973 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:20:54.392995 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.393518 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:20:54.393518 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:20:54.393518 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:20:54.439803 [debug] [Thread-1 (]: SQL status: OK in 0.046 seconds
[0m06:20:54.442696 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:20:54.443124 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:20:54.443627 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.443627 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:20:54.444631 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'caf7f73e-693c-4f2c-9ba8-fccd221f20b2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6D28A2A0>]}
[0m06:20:54.444631 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.37s]
[0m06:20:54.445633 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:20:54.446138 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:20:54.446138 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:20:54.447330 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:20:54.447330 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:20:54.450029 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:20:54.451036 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:20:54.453043 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:20:54.453548 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:20:54.454053 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:20:54.454053 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.454386 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:54.454386 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:20:54.454386 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.455891 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.456894 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:20:54.458401 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:20:54.458941 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:20:54.458941 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:20:54.458941 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:20:54.460447 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:20:54.461043 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:20:54.461755 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:20:54.461755 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:20:54.466734 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:20:54.467997 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:20:54.471711 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:20:54.472712 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:20:54.472712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:20:54.473218 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.473734 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:54.474306 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:20:54.474306 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.475815 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:54.477326 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:20:54.478333 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:20:54.478333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:20:54.478837 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m06:20:54.479842 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:20:54.479842 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:20:54.479842 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:20:54.480848 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:20:54.480848 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:20:54.484494 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:20:54.484999 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:20:54.486754 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:20:54.488259 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:20:54.488259 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:20:54.488259 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.488259 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.489848 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:20:54.490354 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:20:54.490993 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:54.494452 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:20:54.496506 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:20:54.496506 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:20:54.497181 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m06:20:54.497181 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:20:54.498186 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:20:54.498186 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:20:54.498186 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:20:54.498186 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:20:54.501412 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:20:54.501412 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:20:54.505591 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:20:54.506624 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:20:54.506624 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:20:54.506624 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.507605 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:54.507605 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:20:54.508624 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.509161 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:54.510170 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:20:54.511568 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:20:54.511568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:20:54.512593 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:20:54.512593 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:20:54.512593 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:20:54.513795 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:20:54.513795 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:20:54.513795 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:20:54.517596 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:20:54.518282 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:20:54.520816 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:20:54.523530 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:20:54.524532 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:20:54.524532 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.525044 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.525568 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:20:54.525568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.525568 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:20:54.528474 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:20:54.529587 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:20:54.529587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:20:54.529587 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:20:54.529587 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:20:54.531344 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:20:54.531970 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:20:54.533007 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:20:54.533007 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:20:54.536604 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:20:54.537606 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:20:54.538854 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:20:54.540379 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:20:54.540379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:20:54.540379 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.541436 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.541436 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:20:54.541436 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.542442 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.543474 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:20:54.544507 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:20:54.545506 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:20:54.546032 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.01s]
[0m06:20:54.546701 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:20:54.547316 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:20:54.547316 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:20:54.547971 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:20:54.547971 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:20:54.554196 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:20:54.554196 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:20:54.556903 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:20:54.557899 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:20:54.558899 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:20:54.558899 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.559404 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.559922 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:20:54.559922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.559922 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.561434 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:20:54.561938 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:20:54.561938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:20:54.562945 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.01s]
[0m06:20:54.563452 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:20:54.563956 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:20:54.563956 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:20:54.563956 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:20:54.564962 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:20:54.568571 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:20:54.570240 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:20:54.571243 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:20:54.572747 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:20:54.572747 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:20:54.572747 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.573781 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.573781 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:20:54.573781 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.575290 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.575290 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:20:54.576982 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:20:54.577498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:20:54.577498 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.01s]
[0m06:20:54.578504 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:20:54.578504 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:20:54.579008 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:20:54.579008 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:20:54.579008 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:20:54.583793 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:20:54.583793 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:20:54.586019 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:20:54.587029 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:20:54.587029 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:20:54.587029 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.588035 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.588622 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:20:54.588622 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.588622 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.589629 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:20:54.591407 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:20:54.591407 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:20:54.591407 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.01s]
[0m06:20:54.591407 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:20:54.591407 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:20:54.593651 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:20:54.593995 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:20:54.593995 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:20:54.598859 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:20:54.599865 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:20:54.601897 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:20:54.602886 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:20:54.602886 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:20:54.603418 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.603933 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.603933 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:20:54.603933 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.606569 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:20:54.607571 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:20:54.609113 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:20:54.609113 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:20:54.609113 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m06:20:54.610146 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:20:54.610146 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:20:54.611552 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:20:54.611552 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:20:54.612557 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:20:54.616148 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:20:54.617283 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:20:54.619615 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:20:54.620642 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:20:54.620642 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:20:54.620642 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.620642 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.622148 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:20:54.622148 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.623165 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.624169 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:20:54.624169 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:20:54.624169 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:20:54.624169 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.01s]
[0m06:20:54.625910 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:20:54.625910 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:20:54.625910 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:20:54.628084 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:20:54.628084 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:20:54.631498 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:20:54.632192 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:20:54.634215 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:20:54.635196 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:20:54.635196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:20:54.635196 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:20:54.636302 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.636302 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:20:54.636935 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:20:54.636935 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:20:54.638441 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:20:54.639449 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:20:54.639449 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:20:54.639979 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m06:20:54.641049 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:20:54.642183 [debug] [MainThread]: Using duckdb connection "master"
[0m06:20:54.643189 [debug] [MainThread]: On master: BEGIN
[0m06:20:54.643189 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:20:54.643917 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:20:54.643917 [debug] [MainThread]: On master: COMMIT
[0m06:20:54.643917 [debug] [MainThread]: Using duckdb connection "master"
[0m06:20:54.643917 [debug] [MainThread]: On master: COMMIT
[0m06:20:54.643917 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:20:54.645460 [debug] [MainThread]: On master: Close
[0m06:20:54.645460 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:20:54.645460 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:20:54.646468 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:20:54.646468 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:20:54.646468 [info ] [MainThread]: 
[0m06:20:54.647148 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 28.24 seconds (28.24s).
[0m06:20:54.654667 [debug] [MainThread]: Command end result
[0m06:20:54.685495 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:20:54.687501 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:20:54.694538 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:20:54.694538 [info ] [MainThread]: 
[0m06:20:54.695542 [info ] [MainThread]: [31mCompleted with 4 errors, 0 partial successes, and 0 warnings:[0m
[0m06:20:54.695542 [info ] [MainThread]: 
[0m06:20:54.696542 [error] [MainThread]: [31mFailure in test unique_dim_instituicao_id_instituicao (models\gold\schema.yml)[0m
[0m06:20:54.696542 [error] [MainThread]:   Got 8897 results, configured to fail if != 0
[0m06:20:54.696542 [info ] [MainThread]: 
[0m06:20:54.697826 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\unique_dim_instituicao_id_instituicao.sql
[0m06:20:54.697826 [info ] [MainThread]: 
[0m06:20:54.698351 [error] [MainThread]: [31mFailure in test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:20:54.698876 [error] [MainThread]:   Got 158270 results, configured to fail if != 0
[0m06:20:54.698876 [info ] [MainThread]: 
[0m06:20:54.699888 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_capital_pru_dc7c09807e22eeacb03b88bc50c11898.sql
[0m06:20:54.699888 [info ] [MainThread]: 
[0m06:20:54.701024 [error] [MainThread]: [31mFailure in test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:20:54.701024 [error] [MainThread]:   Got 71836 results, configured to fail if != 0
[0m06:20:54.702029 [info ] [MainThread]: 
[0m06:20:54.702029 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_carteira_cr_d80151d1e76d6c8de6ceccc7adebe863.sql
[0m06:20:54.703025 [info ] [MainThread]: 
[0m06:20:54.703529 [error] [MainThread]: [31mFailure in test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_ (models\gold\schema.yml)[0m
[0m06:20:54.703529 [error] [MainThread]:   Got 1 result, configured to fail if != 0
[0m06:20:54.704240 [info ] [MainThread]: 
[0m06:20:54.704240 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_dim_instituicao_b5bf1250f8e22e22ed6029d8a9776333.sql
[0m06:20:54.704748 [info ] [MainThread]: 
[0m06:20:54.705274 [info ] [MainThread]: Done. PASS=93 WARN=0 ERROR=4 SKIP=0 NO-OP=0 TOTAL=97
[0m06:20:54.706302 [debug] [MainThread]: Command `dbt build` failed at 06:20:54.705274 after 29.74 seconds
[0m06:20:54.706302 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6B05EC00>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6A980C80>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000026F6A983FE0>]}
[0m06:20:54.706302 [debug] [MainThread]: Flushing usage events
[0m06:20:55.463109 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:25:58.560772 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC5BCA1850>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC5E3F7590>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC5E3F7470>]}


============================== 06:25:58.565755 | c045761a-bce5-4a15-9608-82fbe7b50dc0 ==============================
[0m06:25:58.565755 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:25:58.568194 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'fail_fast': 'False', 'debug': 'False', 'log_format': 'default', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'indirect_selection': 'eager', 'use_colors': 'True', 'invocation_command': 'dbt build', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:25:58.781954 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC5BD7EBD0>]}
[0m06:25:58.836903 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC5E3F7A70>]}
[0m06:25:58.838409 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:25:59.082368 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:25:59.311041 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 2 files changed.
[0m06:25:59.311544 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_capital_prudencial.sql
[0m06:25:59.311544 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m06:25:59.312571 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m06:25:59.312571 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m06:25:59.313655 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m06:25:59.313655 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m06:25:59.313655 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m06:25:59.314727 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m06:25:59.314727 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\dim_instituicao.sql
[0m06:25:59.811907 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_capital_prudencial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:25:59.812507 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60B4D0A0>]}
[0m06:25:59.990957 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:26:00.002638 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6075E420>]}
[0m06:26:00.111127 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:26:00.114688 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:26:00.190720 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60863470>]}
[0m06:26:00.191226 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:26:00.198245 [info ] [MainThread]: 
[0m06:26:00.198245 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:26:00.199873 [info ] [MainThread]: 
[0m06:26:00.199873 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:26:00.205506 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:26:00.283154 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:26:00.283154 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:26:00.283154 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:26:00.922823 [debug] [ThreadPool]: SQL status: OK in 0.639 seconds
[0m06:26:00.926858 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:26:00.928565 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:26:00.930599 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:26:00.943497 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:26:00.944027 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:26:00.945546 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:26:00.948142 [debug] [ThreadPool]: SQL status: OK in 0.002 seconds
[0m06:26:00.951354 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:26:00.952862 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:26:00.953869 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:26:00.953869 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:26:00.953869 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:26:00.955479 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:26:00.956485 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:26:00.957488 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:26:00.957488 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:26:00.958642 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:26:00.959192 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:26:00.963794 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:26:00.967944 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:26:00.967944 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:26:00.968951 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:26:00.969456 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:26:00.969456 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:26:00.969456 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:26:00.986805 [debug] [ThreadPool]: SQL status: OK in 0.017 seconds
[0m06:26:00.987809 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:26:00.989934 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:26:00.990576 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:26:00.991101 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC5F36BCB0>]}
[0m06:26:00.991677 [debug] [MainThread]: Using duckdb connection "master"
[0m06:26:00.992188 [debug] [MainThread]: On master: BEGIN
[0m06:26:00.992757 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:26:00.993380 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:26:00.993380 [debug] [MainThread]: On master: COMMIT
[0m06:26:00.993380 [debug] [MainThread]: Using duckdb connection "master"
[0m06:26:00.993380 [debug] [MainThread]: On master: COMMIT
[0m06:26:00.994396 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:26:00.994396 [debug] [MainThread]: On master: Close
[0m06:26:00.998288 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:26:00.999832 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:26:01.002842 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:26:01.004123 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:26:01.089844 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:01.093273 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:26:01.168505 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:01.171636 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:01.172636 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:26:01.173187 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:26:01.174186 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:01.175711 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:01.178756 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:26:01.191252 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:26:01.192777 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:26:01.193794 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: ROLLBACK
[0m06:26:01.212316 [debug] [Thread-1 (]: Failed to rollback 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:26:01.213546 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:26:01.224062 [debug] [Thread-1 (]: Runtime Error in model dim_instituicao (models\gold\dim_instituicao.sql)
  Parser Error: syntax error at or near "final_with_id"
[0m06:26:01.232054 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60BE8080>]}
[0m06:26:01.234061 [error] [Thread-1 (]: 1 of 97 ERROR creating sql table model main.dim_instituicao .................... [[31mERROR[0m in 0.22s]
[0m06:26:01.235565 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:26:01.236588 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:26:01.240866 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_instituicao' to be skipped because of status 'error'.  Reason: Runtime Error in model dim_instituicao (models\gold\dim_instituicao.sql)
  Parser Error: syntax error at or near "final_with_id".
[0m06:26:01.239091 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:26:01.242484 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:26:01.243491 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:26:01.252638 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:26:01.256804 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:26:01.262872 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:26:01.265407 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:26:01.265407 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:26:01.267014 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:01.268233 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:01.269777 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:26:01.270805 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:26:01.397645 [debug] [Thread-1 (]: SQL status: OK in 0.125 seconds
[0m06:26:01.421064 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:26:01.421064 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:26:01.425926 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:26:01.456495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:26:01.457404 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:26:01.458425 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:26:01.465182 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:26:01.477866 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:26:01.479457 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:26:01.482927 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:01.489447 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:26:01.492554 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC611D44A0>]}
[0m06:26:01.494682 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.25s]
[0m06:26:01.498041 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:26:01.498041 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:26:01.503058 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:26:01.504566 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:26:01.505484 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:26:01.530481 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:01.532250 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:26:01.540938 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:01.544094 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:01.545797 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:26:01.546465 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:01.548649 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:01.550602 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:01.551194 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:26:01.719662 [debug] [Thread-1 (]: SQL status: OK in 0.167 seconds
[0m06:26:01.725266 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:01.725804 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:26:01.727319 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:01.729594 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:26:01.731400 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:01.732022 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:26:01.735386 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:26:01.740569 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:01.741190 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:26:01.742913 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:01.746003 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:26:01.747304 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D018E60>]}
[0m06:26:01.747970 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.24s]
[0m06:26:01.750311 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:26:01.751747 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:26:01.752750 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:26:01.753801 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:26:01.753801 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:26:01.767066 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:26:01.768760 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:26:01.775932 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:26:01.778208 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:26:01.780814 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:26:01.782041 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:01.783548 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:01.783548 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:26:01.785717 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:26:04.023709 [debug] [Thread-1 (]: SQL status: OK in 2.237 seconds
[0m06:26:04.029813 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:26:04.030124 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:26:04.030820 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:04.030820 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:26:04.032555 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:26:04.032555 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:26:04.173943 [debug] [Thread-1 (]: SQL status: OK in 0.141 seconds
[0m06:26:04.177855 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:26:04.179512 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:26:04.180651 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:04.182304 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:26:04.183278 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D052420>]}
[0m06:26:04.183853 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 2.43s]
[0m06:26:04.186371 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:26:04.186371 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:26:04.186371 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:26:04.188549 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:26:04.188549 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:26:04.194539 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:26:04.196374 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:26:04.199931 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:26:04.201965 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:26:04.202966 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:26:04.203985 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:04.203985 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:04.203985 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:26:04.205773 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Prudencial')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:26:04.459913 [debug] [Thread-1 (]: SQL status: OK in 0.254 seconds
[0m06:26:04.462963 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:26:04.463629 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:26:04.465266 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:04.467956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:26:04.469010 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:26:04.470049 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:26:04.479929 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:26:04.482850 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:26:04.483858 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:26:04.483858 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:04.485934 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:26:04.485934 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D0159A0>]}
[0m06:26:04.486946 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.30s]
[0m06:26:04.486946 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:26:04.487948 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:26:04.488453 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:26:04.488453 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:26:04.488453 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:26:04.492515 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:26:04.493554 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:26:04.498916 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:26:04.499926 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:26:04.500938 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:26:04.501448 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:04.502962 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:04.504084 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:26:04.504084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:26:04.566661 [debug] [Thread-1 (]: SQL status: OK in 0.061 seconds
[0m06:26:04.569086 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:26:04.569086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:26:04.570098 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:04.570098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:26:04.571098 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:26:04.571098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:26:04.593392 [debug] [Thread-1 (]: SQL status: OK in 0.022 seconds
[0m06:26:04.600777 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:26:04.601784 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:26:04.602794 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:04.606026 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:26:04.606554 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D06F860>]}
[0m06:26:04.608572 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.12s]
[0m06:26:04.610851 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:26:04.610851 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:26:04.612560 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:26:04.613506 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:26:04.614515 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:26:04.704326 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:26:04.706074 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:26:04.709615 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:26:04.710912 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:26:04.711417 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:26:04.711417 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:04.712957 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:04.713580 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:26:04.713580 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:26:04.775351 [debug] [Thread-1 (]: SQL status: OK in 0.062 seconds
[0m06:26:04.779100 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:26:04.779624 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:26:04.779624 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:04.782655 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:26:04.782655 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:26:04.783640 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:26:04.864201 [debug] [Thread-1 (]: SQL status: OK in 0.080 seconds
[0m06:26:04.866841 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:26:04.867363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:26:04.867363 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:04.868548 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:26:04.869179 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D0013A0>]}
[0m06:26:04.869179 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.26s]
[0m06:26:04.870211 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:26:04.870211 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:26:04.870211 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:26:04.872268 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:26:04.872268 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:26:04.878842 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:26:04.879838 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:26:04.883576 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:26:04.885733 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:26:04.885733 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:26:04.887261 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:04.888435 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:04.888435 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:26:04.890074 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:26:05.595398 [debug] [Thread-1 (]: SQL status: OK in 0.704 seconds
[0m06:26:05.597502 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:26:05.597502 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:26:05.598239 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:05.598239 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:26:05.599885 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:26:05.599885 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:26:05.743643 [debug] [Thread-1 (]: SQL status: OK in 0.143 seconds
[0m06:26:05.745650 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:26:05.746074 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:26:05.747108 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:05.748253 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:26:05.748253 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60B4D9A0>]}
[0m06:26:05.748830 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.88s]
[0m06:26:05.748830 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:26:05.749841 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:26:05.750346 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:26:05.750346 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:26:05.751353 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:26:05.755382 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:26:05.756390 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:26:05.758894 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:26:05.759902 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:26:05.759902 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:26:05.761624 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:05.762639 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:05.763321 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:26:05.763861 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:26:05.769474 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:26:05.772638 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:26:05.772638 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:26:05.773155 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:05.774166 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:26:05.775168 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:26:05.775168 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:26:05.778719 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:26:05.781095 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:26:05.782226 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:26:05.783233 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:05.783233 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:26:05.784235 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60BE9550>]}
[0m06:26:05.784235 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.03s]
[0m06:26:05.785234 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:26:05.785739 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:26:05.785739 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:26:05.786744 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:26:05.786744 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:26:05.789954 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:26:05.790961 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:26:05.794758 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:26:05.796295 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:26:05.796891 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:26:05.797333 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:05.797874 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:05.797874 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:26:05.797874 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:26:05.833453 [debug] [Thread-1 (]: SQL status: OK in 0.034 seconds
[0m06:26:05.835994 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:26:05.837794 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:26:05.838394 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:05.838394 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:26:05.838394 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:26:05.839962 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:26:05.849659 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:26:05.851386 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:26:05.851386 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:26:05.852891 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:05.853899 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:26:05.854404 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60887950>]}
[0m06:26:05.854404 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.07s]
[0m06:26:05.855410 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:26:05.855410 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:26:05.856025 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:26:05.857030 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:26:05.857030 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:26:05.860895 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:05.862447 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:26:05.869089 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:05.870117 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:05.871100 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:26:05.872103 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:05.874227 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:05.874227 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:05.875238 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:26:06.161528 [debug] [Thread-1 (]: SQL status: OK in 0.286 seconds
[0m06:26:06.163858 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:06.163858 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:26:06.164864 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.165515 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:26:06.165515 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:06.166651 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:26:06.329784 [debug] [Thread-1 (]: SQL status: OK in 0.164 seconds
[0m06:26:06.334285 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:06.334285 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:26:06.335316 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.335989 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:26:06.335989 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60C19970>]}
[0m06:26:06.335989 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.48s]
[0m06:26:06.337627 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:26:06.337627 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:26:06.338613 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:26:06.339138 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:26:06.340864 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:26:06.341395 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:26:06.360246 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:26:06.360246 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:26:06.360246 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.361288 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.361288 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:26:06.361921 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:26:06.362926 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.370679 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:26:06.370679 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.381205 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:26:06.386260 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:26:06.390665 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:26:06.391471 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:26:06.392175 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:26:06.394927 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.397039 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:26:06.398054 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D07E0C0>]}
[0m06:26:06.398560 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.06s]
[0m06:26:06.398560 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:26:06.399565 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:26:06.399565 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:26:06.400199 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:26:06.400199 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:26:06.400199 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:26:06.404379 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:26:06.404379 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:26:06.404379 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.404379 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.406182 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:26:06.406182 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:26:06.407069 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.407747 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:26:06.407747 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.409758 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.409758 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:26:06.411271 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:26:06.411271 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:26:06.412279 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:26:06.412859 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.413866 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:26:06.414372 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60BB5040>]}
[0m06:26:06.414372 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.01s]
[0m06:26:06.414877 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:26:06.415510 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:26:06.415510 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:26:06.416516 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:26:06.416516 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:26:06.416516 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:26:06.420795 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:26:06.420795 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:26:06.420795 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.421488 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.421488 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:26:06.422475 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:26:06.422475 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.423664 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:26:06.423664 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.425693 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.425693 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:26:06.427197 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:26:06.427197 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:26:06.428204 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:26:06.429724 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.430233 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:26:06.431239 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60AEFB00>]}
[0m06:26:06.432246 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.01s]
[0m06:26:06.432989 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:26:06.433998 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:26:06.433998 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:26:06.433998 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:26:06.433998 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:26:06.435503 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:26:06.438010 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:26:06.438804 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:26:06.438804 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.439312 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.439937 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:26:06.439937 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:26:06.439937 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.442965 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:26:06.442965 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.444495 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.444495 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:26:06.445998 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:26:06.447003 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:26:06.447003 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:26:06.448516 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.450218 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:26:06.451224 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6118B920>]}
[0m06:26:06.451224 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.02s]
[0m06:26:06.451224 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:26:06.451224 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:26:06.453108 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:26:06.454120 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:26:06.455133 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:26:06.456655 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:26:06.465704 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:26:06.465704 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:26:06.467547 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.468949 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.468949 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:26:06.470061 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:26:06.470689 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.473348 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:26:06.474349 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.477566 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.478232 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:26:06.482092 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:26:06.482705 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:26:06.482705 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:26:06.485243 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.487776 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:26:06.488287 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6053D100>]}
[0m06:26:06.488287 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.03s]
[0m06:26:06.490008 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:26:06.491016 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:26:06.491439 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:26:06.493073 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:26:06.494098 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:26:06.494098 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:26:06.499663 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:26:06.499663 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:26:06.499663 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.500330 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.500330 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:26:06.500330 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:26:06.501340 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.501340 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:26:06.502940 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.504474 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.505484 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:26:06.507493 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:26:06.508510 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:26:06.509471 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:26:06.511536 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.512431 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:26:06.513543 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60B0AE40>]}
[0m06:26:06.514602 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.02s]
[0m06:26:06.515616 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:26:06.516813 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:26:06.517457 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:26:06.517457 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:26:06.518130 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:26:06.518130 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:26:06.522227 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:26:06.522227 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:26:06.522227 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.523234 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.523234 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:26:06.524241 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:26:06.525239 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.527936 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:26:06.529456 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.532002 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.533058 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:26:06.534061 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:26:06.535069 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:26:06.535578 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:26:06.536609 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.537602 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:26:06.538127 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60BB9B20>]}
[0m06:26:06.538127 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.02s]
[0m06:26:06.538127 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:26:06.538127 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:26:06.539779 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:26:06.539779 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:26:06.539779 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:26:06.540801 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:26:06.543762 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:26:06.544774 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:26:06.545777 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.546300 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.546300 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:26:06.546300 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:26:06.547072 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.548100 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:26:06.548629 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.550291 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.551305 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:26:06.553648 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:26:06.553648 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:26:06.553648 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:26:06.555339 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.556360 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:26:06.556360 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D06E030>]}
[0m06:26:06.556360 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.02s]
[0m06:26:06.557343 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:26:06.557343 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:26:06.558344 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:26:06.558851 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:26:06.558851 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:26:06.559856 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:26:06.562599 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:26:06.562599 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:26:06.562599 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.563628 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.563628 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:26:06.563628 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:26:06.564691 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.565218 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:26:06.565218 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.566910 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.566910 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:26:06.569469 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:26:06.570168 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:26:06.570168 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:26:06.571165 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.571165 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:26:06.571165 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60B9B3B0>]}
[0m06:26:06.572987 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.01s]
[0m06:26:06.572987 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:26:06.573718 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:26:06.573718 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:26:06.573718 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:26:06.573718 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:26:06.575224 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:26:06.577769 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:26:06.577769 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:26:06.578429 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.578429 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.578429 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:26:06.578429 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:26:06.579457 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.579457 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:26:06.579457 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:26:06.582220 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.582747 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:26:06.584279 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:26:06.584279 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:26:06.584279 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:26:06.586086 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.586086 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:26:06.586086 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D04BC20>]}
[0m06:26:06.587725 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.01s]
[0m06:26:06.588848 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:26:06.588848 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:26:06.589860 [info ] [Thread-1 (]: 22 of 97 SKIP test not_null_dim_instituicao_id_instituicao ..................... [[33mSKIP[0m]
[0m06:26:06.589860 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:26:06.590868 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:26:06.590868 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed' to be skipped because of status 'skipped'. 
[0m06:26:06.590868 [info ] [Thread-1 (]: 23 of 97 SKIP test not_null_dim_instituicao_id_localizacao ..................... [[33mSKIP[0m]
[0m06:26:06.590868 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:26:06.590868 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:26:06.590868 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957' to be skipped because of status 'skipped'. 
[0m06:26:06.592733 [info ] [Thread-1 (]: 24 of 97 SKIP test unique_dim_instituicao_id_instituicao ....................... [[33mSKIP[0m]
[0m06:26:06.592733 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:26:06.592733 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:26:06.593737 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37' to be skipped because of status 'skipped'. 
[0m06:26:06.593737 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:26:06.593737 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:26:06.593737 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:26:06.601267 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:26:06.601267 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:26:06.613776 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:26:06.614782 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:26:06.615287 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:26:06.615820 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.616296 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.616924 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:26:06.617344 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.618726 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.621510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:26:06.622509 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:26:06.622509 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:26:06.622509 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.03s]
[0m06:26:06.623810 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:26:06.623810 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:26:06.623810 [info ] [Thread-1 (]: 26 of 97 SKIP test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[33mSKIP[0m]
[0m06:26:06.625324 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:26:06.626675 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:26:06.626981 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42' to be skipped because of status 'skipped'. 
[0m06:26:06.627500 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:26:06.628191 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:26:06.628191 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:26:06.637749 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:26:06.638810 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:26:06.643902 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:26:06.645405 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:26:06.645405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:26:06.645405 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.646409 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.646911 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:26:06.646911 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:26:06.652180 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:26:06.654185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:26:06.655932 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:26:06.655932 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:26:06.656936 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.03s]
[0m06:26:06.657439 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:26:06.657439 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:26:06.657439 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:26:06.658442 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:26:06.658442 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:26:06.661170 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:26:06.661776 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:26:06.662824 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:26:06.664994 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:26:06.664994 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:26:06.664994 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.666070 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.666779 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:26:06.667289 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.667960 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.670696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:26:06.672695 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:26:06.672695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:26:06.675531 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:26:06.676149 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:26:06.677159 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:26:06.678395 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:26:06.678840 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:26:06.679868 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:26:06.682998 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:26:06.683981 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:26:06.686666 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:26:06.688170 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:26:06.688170 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:26:06.689783 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.691482 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.691482 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:26:06.692504 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:26:06.695590 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.697158 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:26:06.698170 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:26:06.698170 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:26:06.698170 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m06:26:06.699757 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:26:06.699757 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:26:06.700364 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:26:06.700364 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:26:06.700364 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:26:06.705540 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:26:06.706571 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:26:06.710228 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:26:06.710934 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:26:06.711947 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:26:06.712408 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.713706 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.713706 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:26:06.714728 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.715251 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.715942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:26:06.717495 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:26:06.717495 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:26:06.718129 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:26:06.718129 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:26:06.719140 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:26:06.719140 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:26:06.720309 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:26:06.720309 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:26:06.723875 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:26:06.723875 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:26:06.727827 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:26:06.729881 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:26:06.730436 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:26:06.730958 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.730958 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.731976 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:26:06.731976 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.732481 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.733487 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:26:06.735002 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:26:06.735002 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:26:06.735634 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m06:26:06.735634 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:26:06.736637 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:26:06.736637 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:06.736637 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:26:06.737654 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:26:06.741364 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:26:06.743398 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:26:06.749085 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:26:06.752941 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:26:06.753957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:26:06.753957 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.755689 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.756701 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:26:06.757704 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.769484 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:26:06.770497 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:26:06.772523 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:26:06.772523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:26:06.773148 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.04s]
[0m06:26:06.774154 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:26:06.774154 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:26:06.775153 [info ] [Thread-1 (]: 33 of 97 SKIP test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:26:06.775153 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:26:06.775153 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:26:06.776914 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01' to be skipped because of status 'skipped'. 
[0m06:26:06.776914 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:26:06.778235 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:26:06.778235 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:26:06.784355 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:26:06.786884 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:26:06.791907 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:26:06.793519 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:26:06.794887 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:26:06.795533 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.797439 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.798098 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:26:06.798098 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.801401 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.802925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:26:06.803938 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:26:06.803938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:26:06.803938 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.03s]
[0m06:26:06.805566 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:26:06.805566 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:26:06.806572 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:26:06.806572 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:26:06.806572 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:26:06.810148 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:26:06.810773 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:26:06.812440 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:26:06.812440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:26:06.812440 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:26:06.814106 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.814703 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.814703 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:26:06.815258 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.815826 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.816848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:26:06.817353 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:26:06.817937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:26:06.817937 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:26:06.818942 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:26:06.818942 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:26:06.818942 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:06.818942 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:26:06.818942 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:26:06.825358 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:26:06.825892 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:26:06.827448 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:26:06.828459 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:26:06.828459 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:26:06.829598 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.829598 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.830612 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:26:06.830612 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.832628 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.833629 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:26:06.835150 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:26:06.835150 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:26:06.835843 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:26:06.835843 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:26:06.836865 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:26:06.836865 [info ] [Thread-1 (]: 37 of 97 SKIP test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:26:06.836865 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:26:06.837848 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:26:06.838375 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c' to be skipped because of status 'skipped'. 
[0m06:26:06.837848 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:26:06.838375 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:26:06.838375 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:26:06.841237 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:26:06.842753 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:26:06.844475 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:26:06.844475 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:26:06.845475 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:26:06.845475 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.845997 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.845997 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:26:06.846631 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.847175 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.848191 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:26:06.848191 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:26:06.848191 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:26:06.848191 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m06:26:06.849915 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:26:06.849915 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:26:06.849915 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:26:06.850926 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:26:06.850926 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:26:06.853431 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:26:06.854437 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:26:06.855949 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:26:06.857454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:26:06.857454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:26:06.857454 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.858462 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.858967 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:26:06.858967 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.859973 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.860980 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:26:06.861485 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:26:06.861485 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:26:06.861485 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:26:06.862491 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:26:06.862491 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:26:06.862491 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:06.863871 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:26:06.863871 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:26:06.867380 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:26:06.869130 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:26:06.871236 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:26:06.872152 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:26:06.872152 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:26:06.872754 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.872754 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.872754 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:26:06.873859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.875472 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.875472 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:26:06.877268 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:26:06.877268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:26:06.878114 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:26:06.878114 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:26:06.878114 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:26:06.879120 [info ] [Thread-1 (]: 41 of 97 SKIP test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:26:06.879622 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:26:06.879622 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:26:06.879622 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29' to be skipped because of status 'skipped'. 
[0m06:26:06.879622 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:26:06.880644 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:26:06.880945 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:26:06.883212 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:26:06.884212 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:26:06.887410 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:26:06.888407 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:26:06.888407 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:26:06.888407 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.889393 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.889393 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:26:06.889393 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.890409 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.891411 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:26:06.892409 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:26:06.892939 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:26:06.892939 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m06:26:06.893460 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:26:06.893460 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:26:06.893460 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:26:06.894987 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:26:06.894987 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:26:06.898068 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:26:06.898596 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:26:06.900649 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:26:06.900649 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:26:06.901643 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:26:06.901643 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.901643 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.901643 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:26:06.901643 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.903147 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.904658 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:26:06.905663 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:26:06.905663 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:26:06.905986 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.01s]
[0m06:26:06.906591 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:26:06.906591 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:26:06.906591 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:06.907598 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:26:06.907598 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:26:06.912231 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:26:06.912563 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:26:06.914187 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:26:06.915711 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:26:06.915711 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:26:06.915711 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.916836 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.916836 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:26:06.917452 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.919207 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:06.921200 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:26:06.922207 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:26:06.922207 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:26:06.922713 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:26:06.923381 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:26:06.923381 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:26:06.924393 [info ] [Thread-1 (]: 45 of 97 SKIP test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:26:06.924393 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:26:06.924393 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:26:06.924393 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33' to be skipped because of status 'skipped'. 
[0m06:26:06.925390 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:26:06.925390 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:26:06.925390 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:26:06.928861 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:26:06.929862 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:26:06.932383 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:26:06.932383 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:26:06.933780 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:26:06.933780 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.933780 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.935311 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:26:06.935311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.936016 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.937538 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:26:06.938546 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:26:06.938546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:26:06.939052 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m06:26:06.939558 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:26:06.939558 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:26:06.939558 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:26:06.941131 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:26:06.941131 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:26:06.943743 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:26:06.944747 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:26:06.947393 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:26:06.948033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:26:06.948033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:26:06.948033 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.949040 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.949040 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:26:06.949040 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.950592 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.951599 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:26:06.952716 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:26:06.952716 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:26:06.952716 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m06:26:06.952716 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:26:06.954453 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:26:06.954453 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:06.954453 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:26:06.955495 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:26:06.959301 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:26:06.959806 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:26:06.963200 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:26:06.963707 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:26:06.964710 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:26:06.964710 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.965240 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.965240 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:26:06.966072 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.968908 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:26:06.970422 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:26:06.971422 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:26:06.971927 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:26:06.971927 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:26:06.972563 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:26:06.972563 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:26:06.972563 [info ] [Thread-1 (]: 49 of 97 SKIP test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:26:06.973697 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:26:06.973697 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:26:06.973697 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71' to be skipped because of status 'skipped'. 
[0m06:26:06.973697 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:26:06.975296 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:26:06.975296 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:26:06.979028 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:26:06.980226 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:26:06.983867 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:26:06.985381 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:26:06.985381 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:26:06.986396 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:06.986909 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:06.986909 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:26:06.987925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:06.989948 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:06.992830 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:26:06.993478 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:26:06.994482 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:26:06.994482 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:26:06.996545 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:26:06.997152 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:26:06.997659 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:26:06.997659 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:26:06.998675 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:26:07.004206 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:26:07.005921 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:26:07.011674 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:26:07.014124 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:26:07.014972 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:26:07.015562 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.016580 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.017095 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:26:07.017735 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:07.018389 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.019592 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:26:07.021616 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:26:07.023127 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:26:07.025046 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.03s]
[0m06:26:07.026075 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:26:07.027610 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:26:07.028036 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:07.028545 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:26:07.028545 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:26:07.033614 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:26:07.035127 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:26:07.036902 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:26:07.038422 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:26:07.038422 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:26:07.039435 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.039435 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.040261 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:26:07.041274 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:07.043734 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:07.045324 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:26:07.045905 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:26:07.045905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:26:07.046606 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:26:07.047284 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:26:07.048024 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:26:07.048024 [info ] [Thread-1 (]: 53 of 97 SKIP test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:26:07.049647 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:26:07.049647 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:26:07.050409 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:26:07.050409 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:26:07.050409 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:26:07.050409 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59' to be skipped because of status 'skipped'. 
[0m06:26:07.054452 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:26:07.057637 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:26:07.060837 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:26:07.061850 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:26:07.061850 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:26:07.062359 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.063561 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.064574 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:26:07.064574 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:07.065739 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.066750 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:26:07.067891 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:26:07.067891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:26:07.068521 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:26:07.069094 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:26:07.069094 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:26:07.069094 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:26:07.070105 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:26:07.070105 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:26:07.075194 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:26:07.076344 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:26:07.078208 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:26:07.079870 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:26:07.079870 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:26:07.079870 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.080881 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.080881 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:26:07.080881 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:07.082224 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.083234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:26:07.084233 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:26:07.084233 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:26:07.084233 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:26:07.085743 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:26:07.085743 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:26:07.085743 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:07.086757 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:26:07.086757 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:26:07.090693 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:26:07.090693 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:26:07.093310 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:26:07.096923 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:26:07.097938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:26:07.098607 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.098607 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.099617 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:26:07.100130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:07.102660 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:07.102660 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:26:07.104315 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:26:07.104315 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:26:07.104315 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:26:07.106041 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:26:07.106041 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:26:07.107055 [info ] [Thread-1 (]: 57 of 97 SKIP test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:26:07.108567 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:26:07.108567 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:26:07.108567 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871' to be skipped because of status 'skipped'. 
[0m06:26:07.108567 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:26:07.108567 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:26:07.110107 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:26:07.115056 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:26:07.117386 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:26:07.122344 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:26:07.124361 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:26:07.124361 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:26:07.124361 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.125361 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.125361 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:26:07.125911 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:07.126923 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.128376 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:26:07.128376 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:26:07.130116 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:26:07.130116 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.02s]
[0m06:26:07.131180 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:26:07.131688 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:26:07.131688 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:26:07.132241 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:26:07.132241 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:26:07.135628 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:26:07.135628 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:26:07.138154 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:26:07.139248 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:26:07.139804 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:26:07.139804 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.139804 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.140821 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:26:07.140821 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:07.140821 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.142772 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:26:07.143591 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:26:07.143591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:26:07.143591 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:26:07.144653 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:26:07.144653 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:26:07.145662 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:07.145662 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:26:07.145662 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:26:07.151138 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:26:07.152097 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:26:07.155440 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:26:07.156455 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:26:07.157467 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:26:07.158461 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.159465 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.160462 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:26:07.161461 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:07.169510 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:26:07.170524 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:26:07.172038 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:26:07.172038 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:26:07.172038 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m06:26:07.173106 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:26:07.174052 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:26:07.174052 [info ] [Thread-1 (]: 61 of 97 SKIP test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[33mSKIP[0m]
[0m06:26:07.175120 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:26:07.175635 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:26:07.176730 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a' to be skipped because of status 'skipped'. 
[0m06:26:07.175635 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:26:07.177363 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:26:07.178020 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:26:07.183473 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:26:07.183473 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:26:07.186706 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:26:07.188178 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:26:07.188178 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:26:07.189821 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.191842 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.192465 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:26:07.193028 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:26:07.194828 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.197093 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:26:07.197093 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:26:07.197093 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.198832 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:26:07.198832 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:26:07.198832 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:26:07.200439 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.201483 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:26:07.201483 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:26:07.203041 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.204054 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:26:07.204562 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60BA09B0>]}
[0m06:26:07.205573 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.03s]
[0m06:26:07.206596 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:26:07.207591 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:26:07.207591 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:26:07.208593 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:26:07.209137 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:26:07.212391 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:26:07.212901 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:26:07.215452 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:26:07.215452 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:26:07.215452 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:26:07.215452 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:07.217056 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.217056 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:26:07.217056 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:26:07.219145 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.221195 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:26:07.221195 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:26:07.221195 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.222183 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:26:07.223316 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:26:07.223316 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:26:07.224291 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:07.225284 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:26:07.227246 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:26:07.227246 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:07.227955 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:26:07.228991 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60BDA090>]}
[0m06:26:08.123571 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:26:08.127929 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m06:26:08.129957 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:26:08.130967 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:26:08.131980 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:26:08.131980 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:26:08.133473 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:26:08.140718 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:26:08.142767 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:26:08.147430 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:26:08.147983 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:26:08.147983 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:26:08.147983 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.147983 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.149529 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:26:08.149529 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:26:08.150087 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.152615 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:26:08.152615 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:26:08.152615 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.154218 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:26:08.154218 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:26:08.154218 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:26:08.155232 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.156515 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:26:08.157510 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:26:08.157510 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.159002 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:26:08.159002 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D0204D0>]}
[0m06:26:08.160007 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:26:08.160007 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:26:08.161014 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:26:08.161582 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:26:08.161582 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:26:08.161582 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:26:08.163784 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:26:08.165440 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:26:08.168153 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:26:08.169171 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:26:08.169171 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:26:08.169710 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.169710 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.169710 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:26:08.170720 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:26:08.170720 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.173275 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:26:08.173275 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:26:08.174259 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.175258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:26:08.175258 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:26:08.175258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:26:08.175258 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.177626 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:26:08.178665 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:26:08.178977 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.179545 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:26:08.179545 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC61099460>]}
[0m06:26:08.179545 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.02s]
[0m06:26:08.181271 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:26:08.181271 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:26:08.181271 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:26:08.182274 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:26:08.182274 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:26:08.184309 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:26:08.185372 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:26:08.188973 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:26:08.189561 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:26:08.190013 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:26:08.190013 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.190537 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.191131 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:26:08.191131 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:26:08.191634 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.193628 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:26:08.193628 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:26:08.194655 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.195638 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:26:08.196140 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:26:08.196140 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:26:08.196893 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.198697 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:26:08.198697 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:26:08.199708 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.200230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:26:08.200230 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D088D10>]}
[0m06:26:08.201258 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.02s]
[0m06:26:08.201258 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:26:08.201258 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:26:08.202768 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:26:08.202768 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:26:08.202768 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:26:08.205464 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:26:08.206302 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:26:08.208829 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:26:08.208829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:26:08.209858 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:26:08.209858 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.210327 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.210327 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:26:08.210923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:26:08.210923 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.212938 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:26:08.213939 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:26:08.213939 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.213939 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:26:08.215242 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:26:08.215242 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:26:08.216552 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.217798 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:26:08.217798 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:26:08.218542 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.219306 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:26:08.219306 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60B4CEF0>]}
[0m06:26:08.219306 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.02s]
[0m06:26:08.220838 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:26:08.220838 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:26:08.220838 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:26:08.222404 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:26:08.222404 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:26:08.225409 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:26:08.226960 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:26:08.228924 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:26:08.228924 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:26:08.230446 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:26:08.230446 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.231079 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.231079 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:26:08.231583 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:26:08.232156 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.235172 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:26:08.235694 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:26:08.235694 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.236722 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:26:08.236722 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:26:08.237706 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:26:08.238212 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.239845 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:26:08.240858 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:26:08.240858 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.242276 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:26:08.242276 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60AED8E0>]}
[0m06:26:08.242890 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m06:26:08.243497 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:26:08.243497 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:26:08.243497 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:26:08.244501 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:26:08.244501 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:26:08.246612 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:26:08.246612 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:26:08.248768 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:26:08.250412 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:26:08.250412 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:26:08.250412 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.251422 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.251422 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:26:08.251422 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:26:08.252416 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.254455 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:26:08.254455 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:26:08.254455 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.256001 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:26:08.256001 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:26:08.256001 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:26:08.256994 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.258507 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:26:08.258507 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:26:08.258507 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.260279 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:26:08.260896 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC610DC770>]}
[0m06:26:08.260896 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m06:26:08.261908 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:26:08.262437 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:26:08.262437 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:26:08.262437 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:26:08.262437 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:26:08.265837 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:26:08.266840 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:26:08.268814 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:26:08.269357 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:26:08.269357 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:26:08.270370 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.270370 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.270370 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:26:08.270370 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:26:08.271367 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.273449 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:26:08.273449 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:26:08.274524 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.275071 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:26:08.275071 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:26:08.275071 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:26:08.276092 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.279725 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:26:08.279725 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:26:08.280731 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.281235 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:26:08.282242 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D0B0A40>]}
[0m06:26:08.282746 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m06:26:08.283754 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:26:08.283754 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:26:08.283754 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:26:08.285258 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:26:08.285258 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:26:08.286872 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:26:08.288376 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:26:08.289859 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:26:08.290890 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:26:08.290890 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:26:08.290890 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.290890 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.292568 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:26:08.292568 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:26:08.293627 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.295650 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:26:08.295650 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:26:08.296174 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.296755 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:26:08.297372 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:26:08.297372 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:26:08.297974 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.298803 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:26:08.300308 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:26:08.300308 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.301312 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:26:08.301312 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D050080>]}
[0m06:26:08.301312 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m06:26:08.302816 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:26:08.303328 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:26:08.303840 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:26:08.303840 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:26:08.303840 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:26:08.306439 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:26:08.307425 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:26:08.308951 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:26:08.309974 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:26:08.309974 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:26:08.309974 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.310991 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.310991 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:26:08.311566 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:26:08.311566 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.312595 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:26:08.312595 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:26:08.314035 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:26:08.314035 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m06:26:08.315041 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:26:08.315041 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:26:08.315553 [info ] [Thread-1 (]: 73 of 97 SKIP test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[33mSKIP[0m]
[0m06:26:08.315553 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:26:08.315553 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:26:08.315553 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0' to be skipped because of status 'skipped'. 
[0m06:26:08.316567 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:26:08.316567 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:26:08.317177 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:26:08.319107 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:26:08.320134 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:26:08.322139 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:26:08.322139 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:26:08.323252 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:26:08.323252 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.323252 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.324252 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:26:08.324252 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:26:08.325261 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.326880 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:26:08.327500 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:26:08.328126 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:26:08.328126 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.01s]
[0m06:26:08.328126 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:26:08.328126 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:26:08.329752 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:26:08.330370 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:26:08.330370 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:26:08.335005 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:26:08.335634 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:26:08.338144 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:26:08.339151 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:26:08.339151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:26:08.339151 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.340151 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.340657 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:26:08.340657 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:26:08.340657 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.342664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:26:08.342664 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:26:08.343663 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:26:08.343663 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:26:08.344663 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:26:08.344663 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:26:08.344663 [info ] [Thread-1 (]: 76 of 97 SKIP test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[33mSKIP[0m]
[0m06:26:08.345663 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:26:08.346262 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:26:08.346262 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e' to be skipped because of status 'skipped'. 
[0m06:26:08.346682 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:26:08.346682 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:26:08.346682 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:26:08.349835 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:26:08.350840 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:26:08.352842 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:26:08.353347 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:26:08.353347 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:26:08.354352 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.354352 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.354352 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:26:08.354352 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:26:08.356368 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.357394 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:26:08.358389 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:26:08.358389 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:26:08.358389 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:26:08.358389 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:26:08.359988 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:26:08.359988 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:26:08.360517 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:26:08.361097 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:26:08.364089 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:26:08.364699 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:26:08.365832 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:26:08.366861 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:26:08.367456 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:26:08.367456 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.367985 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.368301 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:26:08.368301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:26:08.369315 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.370340 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:26:08.370340 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:26:08.370340 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:26:08.371336 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:26:08.371336 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:26:08.371336 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:26:08.372802 [info ] [Thread-1 (]: 79 of 97 SKIP test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[33mSKIP[0m]
[0m06:26:08.372802 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:26:08.372802 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:26:08.372802 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f' to be skipped because of status 'skipped'. 
[0m06:26:08.373807 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:26:08.373807 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:26:08.373807 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:26:08.376919 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:26:08.377924 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:26:08.379924 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:26:08.379924 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:26:08.379924 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:26:08.380995 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.381523 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.381523 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:26:08.381523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:26:08.383056 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:08.384058 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:26:08.384058 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:26:08.385056 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:26:08.385056 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:26:08.385630 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:26:08.385630 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:26:08.385630 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:26:08.387163 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:26:08.387163 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:26:08.389894 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:26:08.390902 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:26:08.394485 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:26:08.395483 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:26:08.396131 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:26:08.396131 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:08.396695 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:08.396695 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:26:08.397275 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:26:16.632383 [debug] [Thread-1 (]: SQL status: OK in 8.236 seconds
[0m06:26:16.635821 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:26:16.635821 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:26:16.636927 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:16.637930 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:26:16.638542 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:26:16.638542 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:26:16.770332 [debug] [Thread-1 (]: SQL status: OK in 0.132 seconds
[0m06:26:16.772843 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:26:16.772843 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:26:16.772843 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:16.773849 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:26:16.775378 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC60BF5C10>]}
[0m06:26:16.775378 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 8.39s]
[0m06:26:16.775378 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:26:16.775378 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:26:16.777088 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:26:16.778636 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:26:16.778636 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:26:16.782489 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:26:16.783213 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:26:16.785732 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:26:16.786761 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:26:16.787747 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:26:16.787747 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:16.788796 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:16.788796 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:26:16.788796 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:26:16.944246 [debug] [Thread-1 (]: SQL status: OK in 0.156 seconds
[0m06:26:16.947196 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:26:16.947196 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:26:16.948485 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:16.949096 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:26:16.950220 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:26:16.950220 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:26:16.956596 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:26:16.957669 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:26:16.958675 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:26:16.959179 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:16.959713 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:26:16.960225 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC610DEFF0>]}
[0m06:26:16.960808 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.18s]
[0m06:26:16.960808 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:26:16.962059 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:26:16.962059 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:26:16.962615 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:26:16.963258 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:26:16.966962 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:26:16.968042 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:26:16.970813 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:26:16.972421 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:26:16.973429 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:26:16.973429 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:16.973429 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:16.974481 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:26:16.974481 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:26:29.448326 [debug] [Thread-1 (]: SQL status: OK in 12.474 seconds
[0m06:26:29.453066 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:26:29.453066 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:26:29.453696 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:29.454222 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:26:29.454222 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:26:29.454222 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:26:29.488105 [debug] [Thread-1 (]: SQL status: OK in 0.033 seconds
[0m06:26:29.491206 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:26:29.491206 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:26:29.491206 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:29.492754 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:26:29.493359 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC0C10C290>]}
[0m06:26:29.493359 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 12.53s]
[0m06:26:29.494372 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:26:29.494372 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:26:29.494372 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:26:29.495372 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:26:29.495372 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:26:29.498976 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:26:29.499609 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:26:29.502833 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:26:29.503839 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:26:29.504344 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:26:29.504344 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:29.504344 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:29.504344 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:26:29.505849 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:26:29.726133 [debug] [Thread-1 (]: SQL status: OK in 0.220 seconds
[0m06:26:29.728646 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:26:29.728646 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:26:29.729650 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:29.729650 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:26:29.730752 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:26:29.730752 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:26:29.737706 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:26:29.739957 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:26:29.739957 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:26:29.740970 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:29.740970 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:26:29.742469 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D092D20>]}
[0m06:26:29.742469 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.25s]
[0m06:26:29.743482 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:26:29.743482 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:26:29.743482 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:26:29.744988 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:26:29.744988 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:26:29.748032 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:26:29.748543 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:26:29.751074 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:26:29.752604 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:26:29.752604 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:26:29.752604 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:29.754351 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:29.754351 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:26:29.754351 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:26:30.075086 [debug] [Thread-1 (]: SQL status: OK in 0.320 seconds
[0m06:26:30.077597 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:26:30.078108 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:26:30.078674 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:30.078674 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:26:30.079683 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:26:30.080108 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:26:30.133332 [debug] [Thread-1 (]: SQL status: OK in 0.054 seconds
[0m06:26:30.140713 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:26:30.141222 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:26:30.142956 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.144640 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:26:30.145659 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c045761a-bce5-4a15-9608-82fbe7b50dc0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC0C11BE00>]}
[0m06:26:30.146796 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.40s]
[0m06:26:30.147421 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:26:30.148075 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:26:30.148075 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:26:30.149757 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:26:30.150455 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:26:30.155453 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:26:30.157467 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:26:30.161011 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:26:30.162720 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:26:30.163066 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:26:30.163739 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.164267 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.164774 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:26:30.164774 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.165779 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:30.168086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:26:30.169744 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:26:30.170272 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:26:30.172298 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.02s]
[0m06:26:30.173862 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:26:30.173862 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:26:30.175387 [info ] [Thread-1 (]: 87 of 97 SKIP test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[33mSKIP[0m]
[0m06:26:30.175387 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:26:30.177120 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:26:30.178334 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e' to be skipped because of status 'skipped'. 
[0m06:26:30.178334 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:26:30.179951 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:26:30.179951 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:26:30.185706 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:26:30.186729 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:26:30.189761 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:26:30.190792 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:26:30.190792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:26:30.192499 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.192499 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.193512 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:26:30.194019 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:26:30.196744 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:30.198325 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:26:30.200024 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:26:30.200024 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:26:30.201054 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m06:26:30.202031 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:26:30.203028 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:26:30.203531 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:26:30.204033 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:26:30.204033 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:26:30.210204 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:26:30.210839 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:26:30.215036 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:26:30.217659 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:26:30.218580 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:26:30.219093 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.220622 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.220622 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:26:30.221641 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.222666 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.225493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:26:30.227120 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:26:30.228678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:26:30.228678 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:26:30.230687 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:26:30.231192 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:26:30.231192 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:26:30.232198 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:26:30.232706 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:26:30.237917 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:26:30.240018 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:26:30.242911 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:26:30.244446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:26:30.245443 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:26:30.245945 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.246448 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.247072 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:26:30.247072 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.248081 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.251087 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:26:30.252596 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:26:30.252596 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:26:30.254193 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:26:30.254193 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:26:30.256314 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:26:30.256314 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:26:30.257350 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:26:30.257350 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:26:30.265364 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:26:30.268017 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:26:30.270549 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:26:30.273101 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:26:30.273101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:26:30.274063 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.274063 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.275083 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:26:30.275083 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.276896 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.277566 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:26:30.279583 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:26:30.279583 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:26:30.280607 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.02s]
[0m06:26:30.281113 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:26:30.282116 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:26:30.282619 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:26:30.283628 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:26:30.283628 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:26:30.290635 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:26:30.293354 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:26:30.298031 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:26:30.299546 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:26:30.300141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:26:30.300141 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.301276 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.301276 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:26:30.302894 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.303944 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.306648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:26:30.308654 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:26:30.308654 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:26:30.310231 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.03s]
[0m06:26:30.311903 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:26:30.312413 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:26:30.313938 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:26:30.315067 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:26:30.315691 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:26:30.320521 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:26:30.322036 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:26:30.326203 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:26:30.327761 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:26:30.328266 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:26:30.328266 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.328266 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:30.328266 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:26:30.329875 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.330882 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.331937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:26:30.333236 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:26:30.333236 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:26:30.334745 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.02s]
[0m06:26:30.336396 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:26:30.336396 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:26:30.337903 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:26:30.338477 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:26:30.338477 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:26:30.344033 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:26:30.346788 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:26:30.350429 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:26:30.351436 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:26:30.351436 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:26:30.352982 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.353505 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.354520 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:26:30.354520 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.355533 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.358537 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:26:30.360175 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:26:30.360811 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:26:30.360811 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m06:26:30.362988 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:26:30.362988 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:26:30.363552 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:26:30.363552 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:26:30.363552 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:26:30.372011 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:26:30.374601 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:26:30.377133 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:26:30.378239 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:26:30.378239 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:26:30.378239 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.382865 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:26:30.383886 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:26:30.383886 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.388529 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:26:30.390067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:26:30.390696 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:26:30.392764 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:26:30.393345 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.03s]
[0m06:26:30.394354 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:26:30.395354 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:26:30.395860 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:26:30.396367 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:26:30.396933 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:26:30.402577 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:26:30.402577 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:26:30.406568 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:26:30.408569 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:26:30.409081 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:26:30.409081 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.409081 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:30.410088 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:26:30.410088 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.411926 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.413992 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:26:30.414503 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:26:30.415512 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:26:30.416021 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.02s]
[0m06:26:30.416528 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:26:30.417109 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:26:30.417772 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:26:30.418418 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:26:30.418970 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:26:30.423501 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:26:30.425580 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:26:30.428201 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:26:30.430376 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:26:30.430905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:26:30.430905 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:30.430905 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:30.431916 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:26:30.431916 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:26:30.433352 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:30.435459 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:26:30.436473 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:26:30.436473 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:26:30.438627 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.02s]
[0m06:26:30.439791 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:26:30.440799 [debug] [MainThread]: Using duckdb connection "master"
[0m06:26:30.441915 [debug] [MainThread]: On master: BEGIN
[0m06:26:30.442463 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:26:30.442463 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:26:30.443469 [debug] [MainThread]: On master: COMMIT
[0m06:26:30.443469 [debug] [MainThread]: Using duckdb connection "master"
[0m06:26:30.444509 [debug] [MainThread]: On master: COMMIT
[0m06:26:30.444509 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:26:30.445508 [debug] [MainThread]: On master: Close
[0m06:26:30.446014 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:26:30.446014 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:26:30.446561 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:26:30.447101 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:26:30.447101 [info ] [MainThread]: 
[0m06:26:30.448114 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 30.25 seconds (30.25s).
[0m06:26:30.461819 [debug] [MainThread]: Command end result
[0m06:26:30.494634 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:26:30.497639 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:26:30.506122 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:26:30.507184 [info ] [MainThread]: 
[0m06:26:30.507727 [info ] [MainThread]: [31mCompleted with 1 error, 0 partial successes, and 0 warnings:[0m
[0m06:26:30.507727 [info ] [MainThread]: 
[0m06:26:30.508787 [error] [MainThread]: [31mFailure in model dim_instituicao (models\gold\dim_instituicao.sql)[0m
[0m06:26:30.508787 [error] [MainThread]:   Runtime Error in model dim_instituicao (models\gold\dim_instituicao.sql)
  Parser Error: syntax error at or near "final_with_id"
[0m06:26:30.508787 [info ] [MainThread]: 
[0m06:26:30.509836 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\dim_instituicao.sql
[0m06:26:30.509836 [info ] [MainThread]: 
[0m06:26:30.509836 [info ] [MainThread]: Done. PASS=80 WARN=0 ERROR=1 SKIP=16 NO-OP=0 TOTAL=97
[0m06:26:30.510416 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 21 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:26:30.511048 [debug] [MainThread]: Command `dbt build` failed at 06:26:30.511048 after 32.10 seconds
[0m06:26:30.511842 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC5E8B7CB0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC5E30E720>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DC6D099940>]}
[0m06:26:30.512212 [debug] [MainThread]: Flushing usage events
[0m06:26:31.278272 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:28:32.072349 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5DEED1970>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E15C0B90>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E15C0BF0>]}


============================== 06:28:32.078508 | 454d8ed3-0638-4126-9715-43b675084af2 ==============================
[0m06:28:32.078508 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:28:32.080017 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'indirect_selection': 'eager', 'use_colors': 'True', 'invocation_command': 'dbt build', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:28:32.278078 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E256D790>]}
[0m06:28:32.335007 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E1981E20>]}
[0m06:28:32.337976 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:28:32.577860 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:28:32.788363 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed.
[0m06:28:32.789413 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m06:28:32.789413 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_capital_prudencial.sql
[0m06:28:32.790424 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m06:28:32.790424 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m06:28:32.791432 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m06:28:32.791432 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m06:28:32.792007 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m06:28:32.792007 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m06:28:32.792831 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\dim_instituicao.sql
[0m06:28:33.214544 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:28:33.215563 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3E1ABD0>]}
[0m06:28:33.363205 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:28:33.376349 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3CA7860>]}
[0m06:28:33.452945 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:28:33.455469 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:28:33.500858 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3718BC0>]}
[0m06:28:33.500858 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:28:33.506501 [info ] [MainThread]: 
[0m06:28:33.506501 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:28:33.507483 [info ] [MainThread]: 
[0m06:28:33.507483 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:28:33.513865 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:28:33.575556 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:28:33.575556 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:28:33.576600 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:28:33.699788 [debug] [ThreadPool]: SQL status: OK in 0.123 seconds
[0m06:28:33.700477 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:28:33.701991 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:28:33.701991 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:28:33.711023 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:28:33.711023 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:28:33.712252 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:28:33.712985 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:28:33.714687 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:28:33.715209 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:28:33.715830 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:28:33.715830 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:28:33.715830 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:28:33.717379 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:28:33.718060 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:28:33.718060 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:28:33.719083 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:28:33.719716 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:28:33.719716 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:28:33.724022 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:28:33.730014 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:28:33.731030 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:28:33.731030 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:28:33.732242 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:28:33.732242 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:28:33.733261 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:28:33.747829 [debug] [ThreadPool]: SQL status: OK in 0.015 seconds
[0m06:28:33.748542 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:28:33.749572 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:28:33.750222 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:28:33.750810 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3DFC890>]}
[0m06:28:33.750810 [debug] [MainThread]: Using duckdb connection "master"
[0m06:28:33.750810 [debug] [MainThread]: On master: BEGIN
[0m06:28:33.750810 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:28:33.751922 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:28:33.751922 [debug] [MainThread]: On master: COMMIT
[0m06:28:33.751922 [debug] [MainThread]: Using duckdb connection "master"
[0m06:28:33.751922 [debug] [MainThread]: On master: COMMIT
[0m06:28:33.752919 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:28:33.752919 [debug] [MainThread]: On master: Close
[0m06:28:33.756720 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:28:33.757753 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:28:33.758708 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:28:33.758708 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:28:33.771137 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:28:33.772140 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:28:33.794995 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:28:33.796506 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:28:33.796506 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:28:33.796506 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:28:33.797571 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:33.797571 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:28:33.798076 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange

)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:28:34.365818 [debug] [Thread-1 (]: SQL status: OK in 0.567 seconds
[0m06:28:34.372006 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:28:34.372006 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:28:34.373034 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.382812 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:28:34.383829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:28:34.384828 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:28:34.399403 [debug] [Thread-1 (]: SQL status: OK in 0.015 seconds
[0m06:28:34.406396 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:28:34.407424 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:28:34.408424 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.411215 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:28:34.414131 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3D631A0>]}
[0m06:28:34.414653 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.65s]
[0m06:28:34.415666 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:28:34.415666 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:28:34.415666 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:28:34.417384 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:28:34.418017 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:28:34.422117 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:28:34.423145 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:28:34.428232 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:28:34.428232 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:28:34.428232 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:28:34.428232 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:34.430171 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.430171 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:28:34.431409 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:28:34.505568 [debug] [Thread-1 (]: SQL status: OK in 0.074 seconds
[0m06:28:34.507583 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:28:34.508605 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:28:34.509137 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.510159 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:28:34.510159 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:28:34.510159 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:28:34.513021 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:34.515102 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:28:34.515623 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:28:34.515623 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.516714 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:28:34.517315 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3CC70B0>]}
[0m06:28:34.517315 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.10s]
[0m06:28:34.517926 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:28:34.518938 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:28:34.518938 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:28:34.519443 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:28:34.520454 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:28:34.527273 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:28:34.528288 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:28:34.531145 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:28:34.531145 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:28:34.531145 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:28:34.532794 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:34.532794 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.532794 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:28:34.533904 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:28:34.585129 [debug] [Thread-1 (]: SQL status: OK in 0.051 seconds
[0m06:28:34.588374 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:28:34.588374 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:28:34.589923 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.590952 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:28:34.591481 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:28:34.591481 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:28:34.593616 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:34.596274 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:28:34.596274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:28:34.596895 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.598418 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:28:34.598418 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E43F43B0>]}
[0m06:28:34.600503 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.08s]
[0m06:28:34.601507 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:28:34.602507 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:28:34.603037 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:28:34.604060 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:28:34.604060 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:28:34.611884 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:28:34.612926 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:28:34.616052 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:28:34.617080 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:28:34.617080 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:28:34.617585 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:34.617585 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:34.617585 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:28:34.618588 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:28:35.225757 [debug] [Thread-1 (]: SQL status: OK in 0.606 seconds
[0m06:28:35.228179 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:28:35.228179 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:28:35.228179 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:35.229731 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:28:35.229731 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:28:35.230742 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:28:35.386597 [debug] [Thread-1 (]: SQL status: OK in 0.156 seconds
[0m06:28:35.388138 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:28:35.388138 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:28:35.389760 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:35.391322 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:28:35.391322 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E44268D0>]}
[0m06:28:35.391322 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.79s]
[0m06:28:35.392349 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:28:35.393305 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:28:35.393831 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:28:35.393831 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:28:35.393831 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:28:35.397305 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:28:35.398489 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:28:35.400047 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:28:35.401080 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:28:35.402608 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:28:35.402608 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:35.402608 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:35.402608 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:28:35.402608 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Prudencial')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:28:35.570918 [debug] [Thread-1 (]: SQL status: OK in 0.168 seconds
[0m06:28:35.573989 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:28:35.573989 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:28:35.575022 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:35.575543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:28:35.575543 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:28:35.575543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:28:35.585718 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:28:35.588227 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:28:35.588227 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:28:35.588227 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:35.590255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:28:35.590769 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E42DE750>]}
[0m06:28:35.590769 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.20s]
[0m06:28:35.590769 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:28:35.592356 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:28:35.592356 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:28:35.593363 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:28:35.593363 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:28:35.596223 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:28:35.597368 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:28:35.600269 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:28:35.601278 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:28:35.601278 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:28:35.601278 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:35.602789 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:35.602789 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:28:35.603521 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:28:35.645582 [debug] [Thread-1 (]: SQL status: OK in 0.042 seconds
[0m06:28:35.649097 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:28:35.649599 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:28:35.650172 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:35.651175 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:28:35.651175 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:28:35.651175 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:28:35.677086 [debug] [Thread-1 (]: SQL status: OK in 0.025 seconds
[0m06:28:35.679807 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:28:35.679807 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:28:35.681786 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:35.682789 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:28:35.682789 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F582F7C950>]}
[0m06:28:35.683789 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.09s]
[0m06:28:35.683789 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:28:35.684790 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:28:35.685292 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:28:35.686009 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:28:35.686512 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:28:35.691097 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:28:35.692604 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:28:35.695114 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:28:35.696230 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:28:35.696230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:28:35.696738 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:35.698473 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:35.698473 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:28:35.698473 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:28:35.748383 [debug] [Thread-1 (]: SQL status: OK in 0.049 seconds
[0m06:28:35.752936 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:28:35.754443 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:28:35.754443 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:35.757576 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:28:35.757576 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:28:35.758571 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:28:35.897016 [debug] [Thread-1 (]: SQL status: OK in 0.138 seconds
[0m06:28:35.898067 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:28:35.898067 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:28:35.899794 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:35.901545 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:28:35.902547 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E4374050>]}
[0m06:28:35.903054 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.22s]
[0m06:28:35.904062 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:28:35.904062 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:28:35.904062 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:28:35.905768 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:28:35.905768 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:28:35.910139 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:28:35.910694 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:28:35.913719 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:28:35.914727 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:28:35.914727 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:28:35.915233 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:35.915814 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:35.915814 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:28:35.915814 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:28:36.559779 [debug] [Thread-1 (]: SQL status: OK in 0.644 seconds
[0m06:28:36.565135 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:28:36.565835 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:28:36.565835 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:36.567363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:28:36.567363 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:28:36.568378 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:28:36.719953 [debug] [Thread-1 (]: SQL status: OK in 0.151 seconds
[0m06:28:36.720977 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:28:36.720977 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:28:36.722500 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:36.723298 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:28:36.723298 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F582F98950>]}
[0m06:28:36.724528 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.82s]
[0m06:28:36.724528 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:28:36.724528 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:28:36.726544 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:28:36.727552 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:28:36.728129 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:28:36.730793 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:28:36.731808 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:28:36.735278 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:28:36.736918 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:28:36.736918 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:28:36.736918 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:36.737922 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:36.738431 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:28:36.738431 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:28:36.743437 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:28:36.746030 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:28:36.746030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:28:36.747030 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:36.748030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:28:36.748030 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:28:36.748030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:28:36.753605 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:28:36.754622 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:28:36.755606 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:28:36.756110 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:36.757155 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:28:36.757155 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E439C260>]}
[0m06:28:36.758659 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.03s]
[0m06:28:36.759519 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:28:36.759519 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:28:36.759519 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:28:36.760525 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:28:36.761554 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:28:36.764048 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:28:36.765085 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:28:36.767772 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:28:36.768664 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:28:36.768664 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:28:36.768664 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:36.769685 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:36.769685 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:28:36.770674 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:28:36.797328 [debug] [Thread-1 (]: SQL status: OK in 0.027 seconds
[0m06:28:36.799522 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:28:36.799522 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:28:36.800838 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:36.801841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:28:36.801841 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:28:36.801841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:28:36.808386 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:28:36.871726 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:28:36.873253 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:28:36.873253 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:36.875300 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:28:36.875300 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F582FAB4A0>]}
[0m06:28:36.876267 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.11s]
[0m06:28:36.876787 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:28:36.877348 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:28:36.877911 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:28:36.877911 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:28:36.877911 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:28:36.881943 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:28:36.882914 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:28:36.884915 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:28:36.885937 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:28:36.887073 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:28:36.887600 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:36.887600 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:36.887600 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:28:36.888634 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:28:37.248456 [debug] [Thread-1 (]: SQL status: OK in 0.360 seconds
[0m06:28:37.251036 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:28:37.252543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:28:37.252543 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.254159 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:28:37.254159 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:28:37.254159 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:28:37.410342 [debug] [Thread-1 (]: SQL status: OK in 0.156 seconds
[0m06:28:37.411848 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:28:37.412851 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:28:37.412851 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.414357 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:28:37.414862 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3D81040>]}
[0m06:28:37.414862 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.54s]
[0m06:28:37.414862 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:28:37.416149 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:28:37.416660 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:28:37.417288 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:28:37.417288 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:28:37.417815 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:28:37.434093 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:28:37.435093 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:28:37.435598 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.435598 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.435598 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:28:37.435598 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:28:37.436605 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.444893 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:28:37.444893 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.448157 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:37.451673 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:28:37.454295 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:28:37.454295 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:28:37.454295 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:28:37.456165 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.457165 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:28:37.457165 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F582FC2150>]}
[0m06:28:37.458164 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.04s]
[0m06:28:37.459166 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:28:37.459166 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:28:37.459166 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:28:37.461237 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:28:37.461237 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:28:37.461961 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:28:37.465996 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:28:37.465996 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:28:37.466974 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.467986 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.467986 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:28:37.468980 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:28:37.470001 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.472528 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:28:37.473547 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.476522 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:37.477529 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:28:37.480540 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:28:37.481523 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:28:37.481523 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:28:37.484526 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.487049 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:28:37.488084 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E438E330>]}
[0m06:28:37.489050 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 31[0m in 0.03s]
[0m06:28:37.490046 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:28:37.491469 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:28:37.492045 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:28:37.493054 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:28:37.494068 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:28:37.495036 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:28:37.505661 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:28:37.506170 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:28:37.508692 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.510323 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.511772 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:28:37.512460 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:28:37.514487 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.516268 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:28:37.517281 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.521330 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:37.522835 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:28:37.526870 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:28:37.526870 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:28:37.527639 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:28:37.528300 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.529869 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:28:37.530879 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E438C0E0>]}
[0m06:28:37.531386 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.04s]
[0m06:28:37.532391 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:28:37.532391 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:28:37.533401 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:28:37.533401 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:28:37.534906 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:28:37.534906 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:28:37.537925 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:28:37.538575 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:28:37.538575 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.539584 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.540600 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:28:37.541283 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:28:37.542799 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.546024 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:28:37.546798 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.550898 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:37.551901 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:28:37.555574 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:28:37.555574 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:28:37.557647 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:28:37.570425 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m06:28:37.572464 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:28:37.573475 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E43A50D0>]}
[0m06:28:37.573475 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.04s]
[0m06:28:37.575110 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:28:37.575707 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:28:37.577232 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:28:37.577875 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:28:37.577875 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:28:37.577875 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:28:37.583545 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:28:37.583545 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:28:37.583545 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.585745 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.586757 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:28:37.588260 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:28:37.590763 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.593631 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:28:37.593631 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.598307 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:28:37.598307 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:28:37.604299 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:28:37.607051 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:28:37.607051 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:28:37.610327 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.611939 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:28:37.612449 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3E0FB30>]}
[0m06:28:37.612449 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.04s]
[0m06:28:37.614643 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:28:37.615221 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:28:37.615797 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:28:37.617312 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:28:37.617312 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:28:37.617929 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:28:37.621981 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:28:37.622997 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:28:37.622997 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.624501 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.624501 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:28:37.625510 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:28:37.625510 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.628155 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:28:37.629042 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.633310 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:28:37.635427 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:28:37.637448 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:28:37.637972 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:28:37.638611 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:28:37.641450 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.643458 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:28:37.644563 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3D836E0>]}
[0m06:28:37.646304 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.03s]
[0m06:28:37.648511 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:28:37.650576 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:28:37.651605 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:28:37.653115 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:28:37.654628 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:28:37.656012 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:28:37.661346 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:28:37.662873 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:28:37.663878 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.663878 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.664885 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:28:37.665532 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:28:37.666639 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.667876 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:28:37.667876 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.671255 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:37.671255 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:28:37.673748 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:28:37.673748 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:28:37.673748 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:28:37.677425 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.677972 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:28:37.677972 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3DD8A70>]}
[0m06:28:37.679584 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.02s]
[0m06:28:37.680589 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:28:37.681093 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:28:37.681625 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:28:37.682148 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:28:37.683172 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:28:37.683172 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:28:37.688226 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:28:37.688226 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:28:37.688226 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.689811 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.690817 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:28:37.691348 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:28:37.692457 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.694021 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:28:37.694021 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.697243 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.698409 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:28:37.701929 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:28:37.701929 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:28:37.701929 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:28:37.704531 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.705538 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:28:37.705538 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3DA3D40>]}
[0m06:28:37.706543 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.02s]
[0m06:28:37.708565 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:28:37.708565 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:28:37.708565 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:28:37.710179 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:28:37.710807 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:28:37.710807 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:28:37.717741 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:28:37.718554 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:28:37.719169 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.721176 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.721176 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:28:37.722652 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:28:37.724611 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.727125 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:28:37.727908 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.730491 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.732003 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:28:37.735520 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:28:37.736527 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:28:37.738547 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:28:37.740580 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.742285 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:28:37.743477 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E43EDFA0>]}
[0m06:28:37.745485 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.03s]
[0m06:28:37.748845 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:28:37.748845 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:28:37.750360 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:28:37.751373 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:28:37.756932 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:28:37.758442 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:28:37.768995 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:28:37.770511 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:28:37.772018 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.773028 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.774025 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:28:37.775597 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:28:37.775597 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.778277 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:28:37.779853 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:28:37.781945 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.781945 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:28:37.785463 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:28:37.785463 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:28:37.785463 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:28:37.787468 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.788590 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:28:37.789595 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F582FA1370>]}
[0m06:28:37.789595 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.04s]
[0m06:28:37.790698 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:28:37.790698 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:28:37.790698 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m06:28:37.792341 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:28:37.792914 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:28:37.808664 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:28:37.811762 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:28:37.841192 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:28:37.843799 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:28:37.843799 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:28:37.845313 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.846820 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.847705 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:28:37.848209 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:37.850832 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.855470 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:28:37.856495 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:28:37.856495 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:28:37.856495 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.06s]
[0m06:28:37.857474 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:28:37.858078 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:28:37.858591 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:28:37.858591 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:28:37.858591 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:28:37.862475 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:28:37.863484 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:28:37.865885 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:28:37.865885 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:28:37.866915 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:28:37.866915 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.867444 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.867444 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:28:37.868230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:28:37.868230 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:37.869784 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:28:37.869784 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:28:37.870779 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:28:37.870779 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:28:37.873008 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:28:37.873008 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:28:37.874017 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:28:37.876371 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:28:37.876371 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:28:37.887797 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:28:37.890612 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:28:37.896306 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:28:37.897945 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:28:37.899529 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:28:37.901141 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.901141 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.902649 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:28:37.902649 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:28:37.909713 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:28:37.913193 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:28:37.914712 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:28:37.915306 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:28:37.916938 [info ] [Thread-1 (]: 24 of 97 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.04s]
[0m06:28:37.918180 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:28:37.919695 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:28:37.920704 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:28:37.920704 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:28:37.920704 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:28:37.927383 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:28:37.927955 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:28:37.935025 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:28:37.936067 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:28:37.936067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:28:37.938216 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.938216 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.939820 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:28:37.939820 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:28:37.941351 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.943377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:28:37.943899 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:28:37.945407 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:28:37.946568 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.03s]
[0m06:28:37.947200 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:28:37.947743 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:28:37.948321 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:28:37.948321 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:28:37.948321 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:28:37.954255 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:28:37.955260 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:28:37.958647 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:28:37.960258 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:28:37.960962 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:28:37.960962 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.961969 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.962474 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:28:37.962474 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:37.964560 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:37.966128 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:28:37.967171 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:28:37.967708 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:28:37.968260 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m06:28:37.968806 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:28:37.969319 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:28:37.969862 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:28:37.970873 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:28:37.970873 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:28:37.975391 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:28:37.977134 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:28:37.979551 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:28:37.980561 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:28:37.981067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:28:37.981067 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:37.982082 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:37.982597 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:28:37.982597 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:28:37.986795 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:37.988375 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:28:37.989993 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:28:37.990550 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:28:37.991213 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m06:28:37.992321 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:28:37.993546 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:28:37.994557 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:28:37.995555 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:28:37.996063 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:28:38.002631 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:28:38.004238 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:28:38.008473 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:28:38.011769 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:28:38.012581 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:28:38.013764 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.015349 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:38.015349 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:28:38.016963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.018195 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.020458 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:28:38.023976 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:28:38.023976 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:28:38.025483 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.03s]
[0m06:28:38.025483 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:28:38.027091 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:28:38.028100 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:28:38.029623 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:28:38.030640 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:28:38.036783 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:28:38.038287 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:28:38.040846 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:28:38.041855 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:28:38.041855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:28:38.043507 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.044107 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:38.045626 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:28:38.046205 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:28:38.048465 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:38.050057 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:28:38.051078 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:28:38.051078 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:28:38.051078 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m06:28:38.052587 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:28:38.052587 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:28:38.052587 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:28:38.052587 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:28:38.054262 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:28:38.058405 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:28:38.061094 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:28:38.063691 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:28:38.065275 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:28:38.065839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:28:38.065839 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.066846 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.066846 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:28:38.067390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.067955 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.069466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:28:38.070471 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:28:38.070471 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:28:38.071981 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:28:38.073992 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:28:38.074992 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:28:38.076122 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:28:38.077764 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:28:38.078342 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:28:38.086479 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:28:38.087993 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:28:38.091248 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:28:38.093365 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:28:38.093944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:28:38.095466 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.096098 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.096678 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:28:38.097301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.097992 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.100179 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:28:38.101189 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:28:38.102697 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:28:38.104319 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.03s]
[0m06:28:38.106482 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:28:38.108515 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:28:38.108515 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:28:38.111130 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:28:38.113159 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:28:38.126964 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:28:38.129489 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:28:38.135037 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:28:38.137286 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:28:38.137803 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:28:38.138373 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.138373 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.139982 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:28:38.140566 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.145377 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:28:38.147878 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:28:38.148454 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:28:38.148454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:28:38.149460 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.04s]
[0m06:28:38.149965 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:28:38.149965 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:28:38.150989 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:28:38.150989 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:28:38.150989 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:28:38.156629 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:28:38.157628 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:28:38.159134 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:28:38.160693 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:28:38.161269 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:28:38.161269 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.161878 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.161878 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:28:38.162414 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.167499 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:28:38.168617 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:28:38.169132 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:28:38.170137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:28:38.170137 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:28:38.171137 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:28:38.171137 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:28:38.171137 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:28:38.172136 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:28:38.172136 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:28:38.175690 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:28:38.176693 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:28:38.179509 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:28:38.181160 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:28:38.181160 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:28:38.182164 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.182164 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.183215 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:28:38.183215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.183886 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.185450 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:28:38.185450 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:28:38.186466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:28:38.186466 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.01s]
[0m06:28:38.186466 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:28:38.187970 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:28:38.187970 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:28:38.188540 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:28:38.188540 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:28:38.192284 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:28:38.193377 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:28:38.194409 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:28:38.195408 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:28:38.195964 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:28:38.195964 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.196561 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.196561 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:28:38.196561 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.197591 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.198136 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:28:38.198136 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:28:38.199730 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:28:38.200371 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:28:38.200902 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:28:38.200902 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:28:38.200902 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:28:38.201907 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:28:38.201907 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:28:38.205452 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:28:38.206543 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:28:38.208542 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:28:38.209075 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:28:38.209075 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:28:38.210081 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.210081 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.210676 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:28:38.210676 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.212377 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:38.213882 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:28:38.214931 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:28:38.215685 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:28:38.216195 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:28:38.217025 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:28:38.217025 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:28:38.217588 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:28:38.218134 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:28:38.218134 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:28:38.222162 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:28:38.223167 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:28:38.224195 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:28:38.225182 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:28:38.225182 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:28:38.226341 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.226865 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.226865 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:28:38.226865 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.232139 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:28:38.233647 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:28:38.233647 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:28:38.235156 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:28:38.235156 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:28:38.235858 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:28:38.235858 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:28:38.235858 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:28:38.236862 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:28:38.236862 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:28:38.239934 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:28:38.240946 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:28:38.242545 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:28:38.243572 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:28:38.244080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:28:38.244080 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.244080 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.244080 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:28:38.244080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.245602 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.247107 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:28:38.247107 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:28:38.248114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:28:38.248114 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m06:28:38.248622 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:28:38.248622 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:28:38.248622 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:28:38.249644 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:28:38.250203 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:28:38.253779 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:28:38.255479 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:28:38.257036 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:28:38.257036 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:28:38.257036 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:28:38.258599 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.258599 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.258599 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:28:38.258599 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.260156 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.260811 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:28:38.261834 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:28:38.262473 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:28:38.262473 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:28:38.263495 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:28:38.263495 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:28:38.264569 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:28:38.265123 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:28:38.265736 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:28:38.268921 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:28:38.269931 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:28:38.270931 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:28:38.272455 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:28:38.272455 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:28:38.273468 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.273468 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.273468 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:28:38.273468 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.275553 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:38.278188 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:28:38.278188 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:28:38.278188 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:28:38.279930 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:28:38.279930 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:28:38.280936 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:28:38.280936 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:28:38.280936 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:28:38.282039 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:28:38.285607 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:28:38.286634 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:28:38.288120 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:28:38.289673 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:28:38.290678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:28:38.291183 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.291183 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.291183 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:28:38.291183 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.294202 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:38.296257 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:28:38.297333 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:28:38.297333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:28:38.297883 [error] [Thread-1 (]: 41 of 97 FAIL 71836 relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 71836[0m in 0.02s]
[0m06:28:38.298494 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:28:38.298494 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:28:38.299509 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29' to be skipped because of status 'fail'.  Reason: Got 71836 results, configured to fail if != 0.
[0m06:28:38.299509 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:28:38.300015 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:28:38.301021 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:28:38.304157 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:28:38.304157 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:28:38.306753 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:28:38.306753 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:28:38.306753 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:28:38.308259 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.308259 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.308259 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:28:38.308259 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.309886 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.310895 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:28:38.312620 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:28:38.313173 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:28:38.313715 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m06:28:38.313715 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:28:38.314728 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:28:38.315232 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:28:38.315232 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:28:38.315776 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:28:38.318371 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:28:38.318896 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:28:38.322407 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:28:38.323415 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:28:38.323415 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:28:38.324416 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.325414 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.325414 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:28:38.325921 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.326925 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.328111 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:28:38.328111 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:28:38.328111 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:28:38.329736 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.01s]
[0m06:28:38.329736 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:28:38.329736 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:28:38.330751 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:28:38.331255 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:28:38.331255 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:28:38.336851 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:28:38.337854 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:28:38.339965 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:28:38.340970 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:28:38.340970 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:28:38.340970 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.342033 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.342033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:28:38.342033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.344162 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:38.345667 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:28:38.346255 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:28:38.346255 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:28:38.346911 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:28:38.347925 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:28:38.347925 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:28:38.348458 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:28:38.348458 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:28:38.348458 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:28:38.352521 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:28:38.354168 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:28:38.356107 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:28:38.357112 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:28:38.357112 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:28:38.357112 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.357112 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.358616 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:28:38.358616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.363698 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:28:38.365209 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:28:38.365725 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:28:38.365725 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:28:38.366733 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:28:38.367239 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:28:38.367799 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:28:38.368385 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:28:38.368933 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:28:38.368933 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:28:38.371942 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:28:38.373268 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:28:38.375285 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:28:38.376993 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:28:38.376993 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:28:38.377618 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.378141 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.378141 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:28:38.378141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.378141 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.379682 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:28:38.381196 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:28:38.381196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:28:38.381196 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m06:28:38.382203 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:28:38.382203 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:28:38.383602 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:28:38.383602 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:28:38.383602 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:28:38.386721 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:28:38.388942 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:28:38.391204 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:28:38.392210 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:28:38.392714 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:28:38.392714 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.393304 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.393304 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:28:38.393304 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.394310 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.395819 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:28:38.396906 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:28:38.396906 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:28:38.397440 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m06:28:38.397991 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:28:38.397991 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:28:38.397991 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:28:38.399629 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:28:38.400198 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:28:38.402753 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:28:38.404400 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:28:38.406916 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:28:38.408426 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:28:38.410149 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:28:38.410149 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.410149 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.411156 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:28:38.411156 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.413721 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:28:38.415233 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:28:38.415759 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:28:38.415759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:28:38.416765 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:28:38.417302 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:28:38.417851 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:28:38.417851 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:28:38.418501 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:28:38.419038 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:28:38.424118 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:28:38.425119 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:28:38.425626 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:28:38.427132 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:28:38.427132 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:28:38.428139 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.428644 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.428644 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:28:38.428644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.436237 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:28:38.437850 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:28:38.438377 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:28:38.438377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:28:38.439392 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:28:38.439897 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:28:38.439897 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:28:38.440903 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:28:38.440903 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:28:38.440903 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:28:38.443925 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:28:38.445433 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:28:38.446952 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:28:38.448465 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:28:38.448465 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:28:38.448465 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.449472 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.450171 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:28:38.450171 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.451185 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.451185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:28:38.452690 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:28:38.452690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:28:38.452690 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m06:28:38.454300 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:28:38.454300 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:28:38.455310 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:28:38.455310 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:28:38.456491 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:28:38.460129 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:28:38.460714 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:28:38.462369 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:28:38.463406 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:28:38.463406 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:28:38.463951 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.464492 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.464492 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:28:38.464492 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.465508 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.466522 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:28:38.467702 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:28:38.468311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:28:38.468311 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m06:28:38.469325 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:28:38.469325 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:28:38.469325 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:28:38.470494 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:28:38.470494 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:28:38.474049 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:28:38.475554 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:28:38.477061 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:28:38.477654 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:28:38.478251 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:28:38.478251 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.478251 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.478251 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:28:38.479805 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.482885 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:38.486519 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:28:38.487536 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:28:38.488133 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:28:38.488133 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:28:38.488133 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:28:38.489691 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:28:38.489691 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:28:38.489691 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:28:38.490746 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:28:38.495892 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:28:38.497099 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:28:38.498665 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:28:38.499688 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:28:38.500274 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:28:38.500274 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.500274 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.501278 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:28:38.501278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.504440 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:38.505953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:28:38.506999 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:28:38.506999 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:28:38.506999 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:28:38.508516 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:28:38.508516 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:28:38.508516 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:28:38.510092 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:28:38.510720 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:28:38.513480 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:28:38.515510 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:28:38.518550 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:28:38.520065 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:28:38.520065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:28:38.520065 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.521071 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.521071 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:28:38.521071 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.522071 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.522577 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:28:38.523583 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:28:38.523583 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:28:38.523583 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m06:28:38.525089 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:28:38.525089 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:28:38.525089 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:28:38.526094 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:28:38.526094 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:28:38.529720 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:28:38.530766 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:28:38.533437 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:28:38.533437 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:28:38.534943 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:28:38.534943 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.535567 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.535567 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:28:38.535567 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.536598 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.538122 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:28:38.538122 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:28:38.538122 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:28:38.539745 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:28:38.539745 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:28:38.539745 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:28:38.540751 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:28:38.541257 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:28:38.541257 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:28:38.548045 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:28:38.548575 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:28:38.551150 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:28:38.551150 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:28:38.552660 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:28:38.553176 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.554197 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.554705 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:28:38.555715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.558722 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:38.561041 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:28:38.561681 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:28:38.561681 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:28:38.561681 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:28:38.562715 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:28:38.562715 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:28:38.562715 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:28:38.563846 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:28:38.563846 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:28:38.568414 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:28:38.568919 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:28:38.572433 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:28:38.573441 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:28:38.573441 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:28:38.573441 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.573441 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.574947 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:28:38.574947 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.578708 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:38.579712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:28:38.580724 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:28:38.581230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:28:38.581230 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:28:38.582266 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:28:38.582776 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:28:38.582776 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:28:38.582776 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:28:38.583782 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:28:38.586896 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:28:38.587896 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:28:38.588402 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:28:38.590971 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:28:38.590971 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:28:38.592452 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.593462 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.593462 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:28:38.593462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.595412 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.596004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:28:38.596761 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:28:38.597523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:28:38.598178 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:28:38.598688 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:28:38.598688 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:28:38.599694 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:28:38.599694 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:28:38.600252 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:28:38.602761 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:28:38.604437 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:28:38.606709 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:28:38.607697 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:28:38.607697 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:28:38.608697 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.608697 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.608697 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:28:38.608697 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.610131 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.611140 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:28:38.611854 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:28:38.611854 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:28:38.611854 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:28:38.613021 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:28:38.613726 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:28:38.613726 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:28:38.613726 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:28:38.614732 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:28:38.618253 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:28:38.619285 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:28:38.620331 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:28:38.621347 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:28:38.622334 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:28:38.622840 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.623855 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.623855 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:28:38.623855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.628130 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:28:38.629856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:28:38.629856 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:28:38.630878 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:28:38.630878 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:28:38.630878 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:28:38.630878 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:28:38.632550 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:28:38.632550 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:28:38.632550 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:28:38.636687 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:28:38.638244 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:28:38.640849 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:28:38.642361 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:28:38.642361 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:28:38.643401 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.643401 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.644523 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:28:38.644523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:38.654235 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:28:38.655957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:28:38.656975 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:28:38.656975 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:28:38.656975 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:28:38.658480 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:28:38.658480 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:28:38.658480 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:28:38.658480 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:28:38.660064 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:28:38.661758 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:28:38.662888 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:28:38.667168 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:28:38.668331 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:28:38.669339 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:28:38.669339 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.669339 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.670387 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:28:38.670387 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:28:38.671386 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.673924 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:28:38.673924 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:28:38.674928 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.675449 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:28:38.675449 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:28:38.675449 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:28:38.675449 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.677946 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:28:38.677946 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:28:38.679560 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.681077 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:28:38.682086 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3DCBBF0>]}
[0m06:28:38.682086 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.02s]
[0m06:28:38.683504 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:28:38.683504 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:28:38.683504 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:28:38.685010 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:28:38.685010 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:28:38.687635 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:28:38.688140 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:28:38.691250 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:28:38.692276 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:28:38.692276 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:28:38.692888 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:38.693455 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.693965 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:28:38.693965 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:28:38.695477 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.697840 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:28:38.698458 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:28:38.698458 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.699487 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:28:38.699487 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:28:38.699487 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:28:38.701194 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:38.702698 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:28:38.702698 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:28:38.704303 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:38.705309 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:28:38.705815 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E4437290>]}
[0m06:28:39.623005 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:28:39.625511 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m06:28:39.625511 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:28:39.627096 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:28:39.628110 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:28:39.629906 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:28:39.630545 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:28:39.633591 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:28:39.635638 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:28:39.639150 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:28:39.641360 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:28:39.641755 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:28:39.641755 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.642758 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.642758 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:28:39.642758 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:28:39.644264 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.646779 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:28:39.647285 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:28:39.647900 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.648591 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:28:39.648591 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:28:39.648591 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:28:39.650208 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.651932 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:28:39.651932 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:28:39.652937 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.653940 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:28:39.653940 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E44258E0>]}
[0m06:28:39.654442 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:28:39.655447 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:28:39.655447 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:28:39.656007 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:28:39.657058 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:28:39.657058 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:28:39.659515 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:28:39.660017 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:28:39.663740 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:28:39.664890 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:28:39.665401 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:28:39.665401 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.665401 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.665401 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:28:39.665401 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:28:39.667042 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.669214 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:28:39.669214 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:28:39.669749 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.670744 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:28:39.670744 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:28:39.670744 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:28:39.672249 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.674258 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:28:39.674258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:28:39.675255 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.675255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:28:39.675255 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E4437E30>]}
[0m06:28:39.677219 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.02s]
[0m06:28:39.677914 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:28:39.677914 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:28:39.678919 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:28:39.678919 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:28:39.679919 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:28:39.682163 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:28:39.683269 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:28:39.685775 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:28:39.686781 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:28:39.686781 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:28:39.686781 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.687814 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.687814 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:28:39.688338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:28:39.688338 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.692940 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:28:39.693480 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:28:39.693480 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.694497 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:28:39.695496 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:28:39.695496 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:28:39.696641 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.698748 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:28:39.698748 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:28:39.699771 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.700425 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:28:39.701476 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F582FBE9C0>]}
[0m06:28:39.701476 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.02s]
[0m06:28:39.702437 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:28:39.702943 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:28:39.702943 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:28:39.703948 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:28:39.703948 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:28:39.705459 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:28:39.706466 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:28:39.708977 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:28:39.709982 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:28:39.710991 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:28:39.710991 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.711497 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.711497 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:28:39.711497 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:28:39.713010 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.714662 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:28:39.714662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:28:39.715669 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.716679 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:28:39.716679 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:28:39.716679 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:28:39.717957 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.719470 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:28:39.719470 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:28:39.720477 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.720477 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:28:39.721984 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3DCDAF0>]}
[0m06:28:39.721984 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.02s]
[0m06:28:39.722991 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:28:39.722991 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:28:39.722991 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:28:39.723992 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:28:39.723992 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:28:39.726708 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:28:39.727320 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:28:39.729361 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:28:39.731003 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:28:39.731003 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:28:39.732021 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.732021 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.732021 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:28:39.732021 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:28:39.733230 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.735448 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:28:39.736479 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:28:39.736479 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.737963 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:28:39.737963 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:28:39.738570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:28:39.739582 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.742738 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:28:39.743280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:28:39.743280 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.744284 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:28:39.744284 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F582FE2720>]}
[0m06:28:39.745786 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m06:28:39.746365 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:28:39.746365 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:28:39.746910 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:28:39.746910 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:28:39.746910 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:28:39.748422 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:28:39.749936 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:28:39.751945 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:28:39.753450 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:28:39.753956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:28:39.753956 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.753956 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.753956 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:28:39.753956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:28:39.755533 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.757556 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:28:39.758555 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:28:39.758555 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.758555 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:28:39.760175 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:28:39.760175 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:28:39.761354 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.762451 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:28:39.763458 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:28:39.763964 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.765552 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:28:39.766061 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3DB5910>]}
[0m06:28:39.766061 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m06:28:39.766568 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:28:39.767201 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:28:39.767201 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:28:39.767814 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:28:39.768368 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:28:39.770490 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:28:39.770490 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:28:39.773019 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:28:39.774018 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:28:39.774018 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:28:39.774018 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.775523 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.775523 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:28:39.775523 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:28:39.777465 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.780948 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:28:39.780948 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:28:39.780948 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.783734 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:28:39.783734 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:28:39.783734 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:28:39.785812 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.786836 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:28:39.787835 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:28:39.788341 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.788341 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:28:39.789892 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E3DFBB30>]}
[0m06:28:39.789892 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m06:28:39.789892 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:28:39.790907 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:28:39.790907 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:28:39.790907 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:28:39.790907 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:28:39.794439 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:28:39.794439 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:28:39.798047 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:28:39.799676 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:28:39.800307 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:28:39.800307 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.800307 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.801316 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:28:39.801316 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:28:39.801316 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.804598 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:28:39.804598 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:28:39.805605 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.806110 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:28:39.807116 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:28:39.807116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:28:39.808621 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.810853 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:28:39.810853 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:28:39.810853 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.812366 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:28:39.812366 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E42E5490>]}
[0m06:28:39.813372 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m06:28:39.813876 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:28:39.813876 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:28:39.813876 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:28:39.814882 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:28:39.815386 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:28:39.818233 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:28:39.818233 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:28:39.820787 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:28:39.820787 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:28:39.820787 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:28:39.822299 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.822299 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.822299 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:28:39.823308 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:28:39.824305 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.825311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:28:39.825817 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:28:39.825817 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:28:39.826826 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m06:28:39.826826 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:28:39.827827 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:28:39.827827 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:28:39.828414 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:28:39.828414 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:28:39.834073 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:28:39.835071 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:28:39.837598 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:28:39.838197 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:28:39.838197 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:28:39.838197 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.839786 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.839786 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:28:39.840301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:39.844242 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:28:39.844242 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:28:39.846370 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:28:39.846370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:28:39.846984 [error] [Thread-1 (]: 73 of 97 FAIL 1 relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[31mFAIL 1[0m in 0.02s]
[0m06:28:39.847989 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:28:39.847989 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:28:39.848493 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:28:39.848493 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:28:39.848493 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0' to be skipped because of status 'fail'.  Reason: Got 1 result, configured to fail if != 0.
[0m06:28:39.849542 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:28:39.852630 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:28:39.852630 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:28:39.855772 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:28:39.855772 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:28:39.856780 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:28:39.856780 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.856780 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.856780 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:28:39.856780 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:28:39.859960 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.861478 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:28:39.861478 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:28:39.862487 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:28:39.862995 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.01s]
[0m06:28:39.863503 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:28:39.863503 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:28:39.864507 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:28:39.864507 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:28:39.864507 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:28:39.869023 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:28:39.870056 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:28:39.872130 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:28:39.873143 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:28:39.873143 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:28:39.874144 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.874144 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.874144 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:28:39.875162 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:28:39.875699 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.877215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:28:39.877760 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:28:39.878317 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:28:39.878317 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:28:39.878317 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:28:39.878317 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:28:39.879916 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:28:39.879916 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:28:39.880944 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:28:39.884306 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:28:39.885817 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:28:39.887841 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:28:39.888366 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:28:39.888366 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:28:39.888366 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.889939 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.889939 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:28:39.890500 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:39.891120 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.893385 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:28:39.893922 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:28:39.893922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:28:39.893922 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m06:28:39.895427 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:28:39.895965 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:28:39.895965 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:28:39.896543 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:28:39.897063 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:28:39.900261 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:28:39.901268 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:28:39.902775 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:28:39.903782 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:28:39.903782 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:28:39.904288 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.904288 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.904288 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:28:39.904288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:28:39.906298 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.907301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:28:39.908301 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:28:39.908301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:28:39.908807 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:28:39.908807 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:28:39.909812 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:28:39.909812 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:28:39.909812 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:28:39.909812 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:28:39.913959 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:28:39.914464 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:28:39.917100 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:28:39.918310 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:28:39.918310 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:28:39.918310 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.919313 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.919313 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:28:39.919313 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:28:39.920370 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.921391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:28:39.921917 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:28:39.921917 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:28:39.922929 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:28:39.922929 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:28:39.923932 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:28:39.923932 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:28:39.923932 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:28:39.924931 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:28:39.927954 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:28:39.929867 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:28:39.932379 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:28:39.933383 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:28:39.933383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:28:39.933383 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.934890 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.934890 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:28:39.935525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:28:39.936534 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.938370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:28:39.938370 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:28:39.938370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:28:39.938370 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m06:28:39.939978 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:28:39.940985 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:28:39.940985 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:28:39.940985 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:28:39.940985 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:28:39.943894 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:28:39.945980 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:28:39.947801 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:28:39.948810 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:28:39.949316 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:28:39.949821 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.949821 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.949821 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:28:39.949821 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:28:39.951827 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:28:39.952828 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:28:39.953839 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:28:39.953839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:28:39.953839 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:28:39.953839 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:28:39.953839 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:28:39.955461 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:28:39.955461 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:28:39.955461 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:28:39.958974 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:28:39.960020 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:28:39.962757 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:28:39.963763 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:28:39.963763 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:28:39.963763 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:39.964770 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:39.965277 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:28:39.965277 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:28:46.912479 [debug] [Thread-1 (]: SQL status: OK in 6.947 seconds
[0m06:28:46.915030 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:28:46.915030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:28:46.915708 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:46.916739 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:28:46.916739 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:28:46.917419 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:28:47.038189 [debug] [Thread-1 (]: SQL status: OK in 0.122 seconds
[0m06:28:47.040759 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:28:47.040759 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:28:47.040759 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:47.042374 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:28:47.043381 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E37F8980>]}
[0m06:28:47.043887 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 7.09s]
[0m06:28:47.043887 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:28:47.044604 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:28:47.045112 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:28:47.045622 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:28:47.045622 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:28:47.048525 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:28:47.048525 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:28:47.050924 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:28:47.052485 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:28:47.052485 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:28:47.052992 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:47.052992 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:47.052992 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:28:47.054012 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:28:47.194326 [debug] [Thread-1 (]: SQL status: OK in 0.141 seconds
[0m06:28:47.198060 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:28:47.198060 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:28:47.199172 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:47.200381 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:28:47.200381 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:28:47.200381 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:28:47.205653 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:28:47.207216 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:28:47.207216 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:28:47.208209 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:47.208209 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:28:47.210113 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F58302FBF0>]}
[0m06:28:47.210113 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.16s]
[0m06:28:47.211446 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:28:47.211446 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:28:47.211446 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:28:47.213563 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:28:47.213563 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:28:47.217357 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:28:47.217997 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:28:47.219503 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:28:47.221513 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:28:47.221513 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:28:47.222023 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:28:47.222023 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:28:47.222023 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:28:47.223029 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:29:01.049687 [debug] [Thread-1 (]: SQL status: OK in 13.826 seconds
[0m06:29:01.051395 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:29:01.052917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:29:01.052917 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.053945 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:29:01.053945 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:29:01.053945 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:29:01.085499 [debug] [Thread-1 (]: SQL status: OK in 0.030 seconds
[0m06:29:01.086502 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:29:01.087519 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:29:01.087519 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.088629 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:29:01.089660 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E44351F0>]}
[0m06:29:01.089660 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 13.88s]
[0m06:29:01.090824 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:29:01.090824 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:29:01.090824 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:29:01.090824 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:29:01.090824 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:29:01.093948 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:29:01.096053 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:29:01.098176 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:29:01.099344 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:29:01.099869 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:29:01.099869 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.099869 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.099869 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:29:01.100890 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:29:01.314258 [debug] [Thread-1 (]: SQL status: OK in 0.213 seconds
[0m06:29:01.316048 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:29:01.316048 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:29:01.317158 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.317933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:29:01.317933 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:29:01.317933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:29:01.327627 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:29:01.330915 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:29:01.330915 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:29:01.330915 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.332072 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:29:01.333194 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F58303EFF0>]}
[0m06:29:01.333194 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.24s]
[0m06:29:01.334194 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:29:01.334194 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:29:01.335215 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:29:01.335948 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:29:01.336963 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:29:01.339830 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:29:01.339830 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:29:01.344502 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:29:01.345484 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:29:01.345484 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:29:01.346259 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.346259 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.346940 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:29:01.346940 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:29:01.673493 [debug] [Thread-1 (]: SQL status: OK in 0.327 seconds
[0m06:29:01.675796 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:29:01.675796 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:29:01.678246 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.678246 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:29:01.679802 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:29:01.679802 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:29:01.732057 [debug] [Thread-1 (]: SQL status: OK in 0.051 seconds
[0m06:29:01.733569 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:29:01.735074 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:29:01.735783 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.736788 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:29:01.738298 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '454d8ed3-0638-4126-9715-43b675084af2', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E4437BC0>]}
[0m06:29:01.738298 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.40s]
[0m06:29:01.739815 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:29:01.740911 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:29:01.741402 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:29:01.742898 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:29:01.742898 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:29:01.748530 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:29:01.750068 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:29:01.752589 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:29:01.754258 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:29:01.754258 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:29:01.755994 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.757013 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.757013 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:29:01.757013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.758517 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.760839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:29:01.762360 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:29:01.762935 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:29:01.762935 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.02s]
[0m06:29:01.763940 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:29:01.763940 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:29:01.765008 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:29:01.765513 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:29:01.765513 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:29:01.770047 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:29:01.771048 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:29:01.774143 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:29:01.776732 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:29:01.777244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:29:01.777244 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.777955 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.777955 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:29:01.778963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.780976 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:29:01.782489 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:29:01.783496 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:29:01.783496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:29:01.783496 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m06:29:01.785002 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:29:01.785002 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:29:01.786008 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:29:01.786008 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:29:01.786008 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:29:01.793628 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:29:01.794657 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:29:01.799630 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:29:01.801199 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:29:01.801199 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:29:01.801199 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.802715 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.802715 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:29:01.802715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:29:01.806430 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:29:01.808448 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:29:01.810632 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:29:01.811274 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:29:01.812475 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.03s]
[0m06:29:01.813018 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:29:01.813528 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:29:01.813528 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:29:01.814535 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:29:01.814535 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:29:01.819636 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:29:01.821314 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:29:01.825331 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:29:01.826940 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:29:01.827524 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:29:01.827524 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.827524 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.828534 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:29:01.828534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.829545 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.832568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:29:01.833572 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:29:01.833572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:29:01.833572 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:29:01.835636 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:29:01.835636 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:29:01.835636 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:29:01.837643 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:29:01.838147 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:29:01.843475 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:29:01.846395 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:29:01.848527 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:29:01.850254 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:29:01.850254 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:29:01.850254 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.851261 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.851261 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:29:01.851261 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.852765 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.853792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:29:01.854329 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:29:01.855348 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:29:01.855854 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:29:01.856885 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:29:01.856885 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:29:01.856885 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:29:01.858420 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:29:01.858420 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:29:01.863857 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:29:01.865467 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:29:01.867194 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:29:01.868003 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:29:01.868003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:29:01.868003 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.869010 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.869010 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:29:01.870851 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.872365 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.874386 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:29:01.875777 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:29:01.877606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:29:01.878474 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.02s]
[0m06:29:01.879978 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:29:01.880542 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:29:01.881173 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:29:01.881515 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:29:01.881515 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:29:01.885974 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:29:01.888712 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:29:01.893074 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:29:01.894737 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:29:01.894737 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:29:01.896332 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.896875 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.897342 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:29:01.897342 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.900269 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:29:01.904253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:29:01.905778 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:29:01.906803 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:29:01.906803 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.03s]
[0m06:29:01.908784 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:29:01.908784 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:29:01.910069 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:29:01.911093 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:29:01.911601 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:29:01.915520 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:29:01.917476 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:29:01.921618 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:29:01.922489 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:29:01.923129 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:29:01.923129 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.924133 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:01.924133 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:29:01.925649 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.925649 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.928204 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:29:01.928598 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:29:01.928598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:29:01.930118 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.02s]
[0m06:29:01.930989 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:29:01.930989 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:29:01.931994 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:29:01.931994 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:29:01.931994 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:29:01.935814 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:29:01.937820 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:29:01.940151 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:29:01.940798 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:29:01.940798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:29:01.940798 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.942850 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.943468 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:29:01.943468 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.944487 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.945987 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:29:01.947250 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:29:01.947250 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:29:01.948316 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m06:29:01.950027 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:29:01.950027 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:29:01.950027 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:29:01.951032 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:29:01.951032 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:29:01.956861 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:29:01.956861 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:29:01.960026 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:29:01.961260 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:29:01.961931 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:29:01.962571 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.963583 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.964092 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:29:01.964940 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.970012 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:29:01.971028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:29:01.972028 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:29:01.972028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:29:01.972028 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m06:29:01.973499 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:29:01.973499 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:29:01.973499 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:29:01.975030 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:29:01.975791 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:29:01.978907 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:29:01.979908 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:29:01.982329 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:29:01.983336 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:29:01.983336 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:29:01.983336 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:01.984842 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.984842 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:29:01.985348 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:29:01.985348 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:29:01.986356 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:29:01.988180 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:29:01.988180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:29:01.988683 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.01s]
[0m06:29:01.989689 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:29:01.989689 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:29:01.990754 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:29:01.990754 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:29:01.990754 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:29:01.996286 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:29:01.996928 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:29:01.999973 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:29:02.000478 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:29:02.000478 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:29:02.001485 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:29:02.001485 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:02.001485 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:29:02.001485 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:29:02.003455 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:29:02.004462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:29:02.005470 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:29:02.005470 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:29:02.005975 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.02s]
[0m06:29:02.006981 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:29:02.008485 [debug] [MainThread]: Using duckdb connection "master"
[0m06:29:02.008485 [debug] [MainThread]: On master: BEGIN
[0m06:29:02.008485 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:29:02.008485 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:29:02.008485 [debug] [MainThread]: On master: COMMIT
[0m06:29:02.010205 [debug] [MainThread]: Using duckdb connection "master"
[0m06:29:02.010205 [debug] [MainThread]: On master: COMMIT
[0m06:29:02.010770 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:29:02.010770 [debug] [MainThread]: On master: Close
[0m06:29:02.010770 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:29:02.011775 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:29:02.011775 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:29:02.012280 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:29:02.012280 [info ] [MainThread]: 
[0m06:29:02.012785 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 28.50 seconds (28.50s).
[0m06:29:02.022225 [debug] [MainThread]: Command end result
[0m06:29:02.058718 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:29:02.061920 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:29:02.070840 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:29:02.070840 [info ] [MainThread]: 
[0m06:29:02.070840 [info ] [MainThread]: [31mCompleted with 2 errors, 0 partial successes, and 0 warnings:[0m
[0m06:29:02.072344 [info ] [MainThread]: 
[0m06:29:02.072344 [error] [MainThread]: [31mFailure in test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:29:02.073382 [error] [MainThread]:   Got 71836 results, configured to fail if != 0
[0m06:29:02.073382 [info ] [MainThread]: 
[0m06:29:02.073382 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_carteira_cr_d80151d1e76d6c8de6ceccc7adebe863.sql
[0m06:29:02.074890 [info ] [MainThread]: 
[0m06:29:02.075566 [error] [MainThread]: [31mFailure in test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_ (models\gold\schema.yml)[0m
[0m06:29:02.075566 [error] [MainThread]:   Got 1 result, configured to fail if != 0
[0m06:29:02.077081 [info ] [MainThread]: 
[0m06:29:02.077684 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_dim_instituicao_b5bf1250f8e22e22ed6029d8a9776333.sql
[0m06:29:02.078441 [info ] [MainThread]: 
[0m06:29:02.078441 [info ] [MainThread]: Done. PASS=95 WARN=0 ERROR=2 SKIP=0 NO-OP=0 TOTAL=97
[0m06:29:02.080146 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 21 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:29:02.082096 [debug] [MainThread]: Command `dbt build` failed at 06:29:02.082096 after 30.17 seconds
[0m06:29:02.082601 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E1568CB0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5E156A8A0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001F5DE5C24E0>]}
[0m06:29:02.083608 [debug] [MainThread]: Flushing usage events
[0m06:29:03.006895 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:38:00.791351 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E741696E10>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E73E911940>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E741BA4B90>]}


============================== 06:38:00.797778 | e3a2d008-5917-4c6f-be63-8f92c7ad8826 ==============================
[0m06:38:00.797778 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:38:00.798471 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'invocation_command': 'dbt build', 'indirect_selection': 'eager', 'use_colors': 'True', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:38:01.092406 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743253800>]}
[0m06:38:01.148119 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E742FD8470>]}
[0m06:38:01.150190 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:38:01.405668 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:38:01.628116 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 2 files changed.
[0m06:38:01.628663 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m06:38:01.629707 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_capital_prudencial.sql
[0m06:38:01.629707 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m06:38:01.629707 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m06:38:01.630754 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m06:38:01.630754 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m06:38:01.631327 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m06:38:01.631327 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m06:38:01.631327 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\dim_instituicao.sql
[0m06:38:01.632349 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://seeds\seed_dim_classe_instituicao.csv
[0m06:38:02.222137 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:38:02.222647 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7416D0350>]}
[0m06:38:02.401052 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:38:02.421176 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7434BC9E0>]}
[0m06:38:02.512474 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:38:02.515412 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:38:02.588747 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E74358E6C0>]}
[0m06:38:02.589768 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:38:02.598098 [info ] [MainThread]: 
[0m06:38:02.599753 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:38:02.600350 [info ] [MainThread]: 
[0m06:38:02.601737 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:38:02.611552 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:38:02.716610 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:38:02.716610 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:38:02.717312 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:38:03.315307 [debug] [ThreadPool]: SQL status: OK in 0.598 seconds
[0m06:38:03.317062 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:38:03.318230 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:38:03.319391 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:38:03.324991 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:38:03.325603 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:38:03.325603 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:38:03.327164 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:38:03.327871 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:38:03.328889 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:38:03.328889 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:38:03.328889 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:38:03.328889 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:38:03.329889 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:38:03.331024 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:38:03.332043 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:38:03.332043 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:38:03.332043 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:38:03.333135 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:38:03.335172 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:38:03.340727 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:38:03.340727 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:38:03.342338 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:38:03.342984 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:38:03.342984 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:38:03.342984 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:38:03.356491 [debug] [ThreadPool]: SQL status: OK in 0.013 seconds
[0m06:38:03.357498 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:38:03.360500 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:38:03.360500 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:38:03.361265 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E742FABB30>]}
[0m06:38:03.361265 [debug] [MainThread]: Using duckdb connection "master"
[0m06:38:03.361888 [debug] [MainThread]: On master: BEGIN
[0m06:38:03.361888 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:38:03.361888 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:38:03.362966 [debug] [MainThread]: On master: COMMIT
[0m06:38:03.362966 [debug] [MainThread]: Using duckdb connection "master"
[0m06:38:03.362966 [debug] [MainThread]: On master: COMMIT
[0m06:38:03.363634 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:38:03.363634 [debug] [MainThread]: On master: Close
[0m06:38:03.368082 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:38:03.369112 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:38:03.369642 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:38:03.369642 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:38:03.384213 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:38:03.385211 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:38:03.413626 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:38:03.415149 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:38:03.415667 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:38:03.416685 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:38:03.417196 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:03.417196 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:38:03.417782 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:38:03.997185 [debug] [Thread-1 (]: SQL status: OK in 0.578 seconds
[0m06:38:04.002306 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:38:04.002813 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:38:04.003823 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:04.013660 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:38:04.013660 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:38:04.014673 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:38:04.025051 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:38:04.029839 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:38:04.030862 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:38:04.032209 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:04.034223 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:38:04.037346 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E73E9EDE20>]}
[0m06:38:04.037880 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.67s]
[0m06:38:04.038474 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:38:04.038474 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:38:04.039486 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:38:04.039994 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:38:04.040503 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:38:04.044400 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:38:04.044400 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:38:04.048619 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:38:04.050247 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:38:04.050247 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:38:04.051268 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:04.051268 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:04.051268 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:38:04.052776 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:38:04.129705 [debug] [Thread-1 (]: SQL status: OK in 0.077 seconds
[0m06:38:04.133769 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:38:04.134770 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:38:04.135280 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:04.135875 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:38:04.137405 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:38:04.138050 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:38:04.140751 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:38:04.144078 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:38:04.144078 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:38:04.144078 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:04.146234 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:38:04.146883 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E744F55CD0>]}
[0m06:38:04.147891 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.11s]
[0m06:38:04.148397 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:38:04.148397 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:38:04.148397 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:38:04.149911 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:38:04.149911 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:38:04.156517 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:38:04.158646 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:38:04.161261 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:38:04.161816 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:38:04.162384 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:38:04.162384 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:04.163398 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:04.163398 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:38:04.163907 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:38:04.222160 [debug] [Thread-1 (]: SQL status: OK in 0.058 seconds
[0m06:38:04.225175 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:38:04.225694 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:38:04.225694 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:04.226703 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:38:04.227276 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:38:04.227276 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:38:04.229718 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:04.231343 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:38:04.231894 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:38:04.231894 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:04.232904 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:38:04.233906 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743F1A750>]}
[0m06:38:04.234912 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.08s]
[0m06:38:04.235935 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:38:04.235935 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:38:04.235935 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:38:04.237800 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:38:04.237800 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:38:04.243419 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:38:04.244430 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:38:04.312485 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:38:04.314047 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:38:04.314558 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:38:04.314558 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:04.315567 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:04.315567 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:38:04.316664 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:38:04.970601 [debug] [Thread-1 (]: SQL status: OK in 0.653 seconds
[0m06:38:04.974123 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:38:04.974123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:38:04.975122 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:04.975632 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:38:04.975632 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:38:04.977140 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:38:05.254202 [debug] [Thread-1 (]: SQL status: OK in 0.277 seconds
[0m06:38:05.256787 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:38:05.256787 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:38:05.258298 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:05.258298 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:38:05.258298 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E744F9DD90>]}
[0m06:38:05.259882 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 1.02s]
[0m06:38:05.261399 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:38:05.261904 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:38:05.262544 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:38:05.262544 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:38:05.263556 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:38:05.270651 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:38:05.273181 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:38:05.275686 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:38:05.277464 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:38:05.278105 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:38:05.278105 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:05.278105 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:05.278105 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:38:05.279664 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Prudencial')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:38:05.478495 [debug] [Thread-1 (]: SQL status: OK in 0.198 seconds
[0m06:38:05.481143 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:38:05.482213 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:38:05.482801 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:05.486166 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:38:05.486166 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:38:05.487923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:38:05.500765 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m06:38:05.502776 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:38:05.503286 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:38:05.504294 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:05.506028 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:38:05.506028 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E74391E030>]}
[0m06:38:05.507081 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.24s]
[0m06:38:05.507081 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:38:05.507081 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:38:05.508653 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:38:05.509027 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:38:05.509027 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:38:05.514234 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:38:05.515751 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:38:05.521844 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:38:05.522347 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:38:05.522347 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:38:05.523358 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:05.523358 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:05.524355 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:38:05.525885 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    md5(cast(cast(codigo as bigint) as varchar)) as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:38:05.578323 [debug] [Thread-1 (]: SQL status: OK in 0.052 seconds
[0m06:38:05.583227 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:38:05.584224 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:38:05.585225 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:05.585843 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:38:05.586857 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:38:05.586857 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:38:05.659837 [debug] [Thread-1 (]: SQL status: OK in 0.073 seconds
[0m06:38:05.662418 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:38:05.663425 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:38:05.663933 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:05.665450 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:38:05.665450 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7437DDFA0>]}
[0m06:38:05.666470 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.16s]
[0m06:38:05.667060 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:38:05.667669 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:38:05.668306 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:38:05.668306 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:38:05.669320 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:38:05.674438 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:38:05.675519 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:38:05.679435 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:38:05.681241 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:38:05.682250 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:38:05.682758 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:05.683773 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:05.683773 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:38:05.685666 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:38:05.737938 [debug] [Thread-1 (]: SQL status: OK in 0.052 seconds
[0m06:38:05.739532 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:38:05.740954 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:38:05.741967 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:05.742474 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:38:05.742474 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:38:05.743482 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:38:05.817322 [debug] [Thread-1 (]: SQL status: OK in 0.074 seconds
[0m06:38:05.819063 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:38:05.820079 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:38:05.820079 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:05.821075 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:38:05.822074 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743E54B90>]}
[0m06:38:05.822074 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.15s]
[0m06:38:05.823250 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:38:05.823250 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:38:05.824256 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:38:05.824256 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:38:05.824256 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:38:05.828464 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:38:05.829471 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:38:05.832574 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:38:05.833576 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:38:05.833576 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:38:05.833576 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:05.835094 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:05.835737 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:38:05.835737 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:38:06.433333 [debug] [Thread-1 (]: SQL status: OK in 0.598 seconds
[0m06:38:06.438727 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:38:06.439343 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:38:06.439938 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:06.441107 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:38:06.441107 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:38:06.441634 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:38:06.744152 [debug] [Thread-1 (]: SQL status: OK in 0.302 seconds
[0m06:38:06.746414 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:38:06.746414 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:38:06.747206 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:06.748405 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:38:06.749420 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743BD8BC0>]}
[0m06:38:06.749930 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.93s]
[0m06:38:06.750439 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:38:06.750439 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:38:06.751448 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:38:06.751448 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:38:06.751448 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:38:06.756620 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:38:06.758683 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:38:06.762707 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:38:06.763829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:38:06.764870 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:38:06.765534 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:06.767147 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:06.767909 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:38:06.770504 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:38:06.778349 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:38:06.781835 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:38:06.782344 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:38:06.782344 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:06.784877 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:38:06.785652 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:38:06.785652 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:38:06.789881 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:38:06.792465 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:38:06.792784 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:38:06.792784 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:06.794113 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:38:06.794113 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743DFFE60>]}
[0m06:38:06.794113 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.04s]
[0m06:38:06.795681 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:38:06.796377 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:38:06.796377 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:38:06.797115 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:38:06.798187 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:38:06.801725 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:38:06.804251 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:38:06.810298 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:38:06.812688 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:38:06.813197 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:38:06.814034 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:06.815221 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:06.815934 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:38:06.818005 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:38:06.855846 [debug] [Thread-1 (]: SQL status: OK in 0.036 seconds
[0m06:38:06.858361 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:38:06.858361 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:38:06.858361 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:06.859943 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:38:06.861469 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:38:06.862560 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:38:06.870275 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:38:06.874336 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:38:06.874336 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:38:06.875332 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:06.875847 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:38:06.876857 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7438AC920>]}
[0m06:38:06.877505 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.08s]
[0m06:38:06.878076 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:38:06.878656 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:38:06.880183 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:38:06.881787 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:38:06.882810 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:38:06.886454 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:38:06.888062 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:38:06.890699 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:38:06.890699 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:38:06.892334 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:38:06.892334 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:06.893017 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:06.893017 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:38:06.893566 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:38:07.175824 [debug] [Thread-1 (]: SQL status: OK in 0.282 seconds
[0m06:38:07.179086 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:38:07.179631 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:38:07.179631 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.181145 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:38:07.181145 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:38:07.181145 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:38:07.436588 [debug] [Thread-1 (]: SQL status: OK in 0.255 seconds
[0m06:38:07.439189 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:38:07.439804 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:38:07.439804 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.441822 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:38:07.441822 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743F37E60>]}
[0m06:38:07.442831 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.56s]
[0m06:38:07.443847 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:38:07.443847 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:38:07.443847 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:38:07.445425 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:38:07.445425 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:38:07.445995 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:38:07.471000 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:38:07.471997 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:38:07.472502 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.472502 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.472502 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:38:07.473509 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:38:07.473509 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.481282 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:38:07.482300 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.490638 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:38:07.494494 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:38:07.496580 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:38:07.496580 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:38:07.496580 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:38:07.497726 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.499277 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:38:07.499785 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743E6E240>]}
[0m06:38:07.499785 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.05s]
[0m06:38:07.500534 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:38:07.500534 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:38:07.501547 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:38:07.501547 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:38:07.501547 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:38:07.502548 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:38:07.506313 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:38:07.506313 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:38:07.506313 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.507312 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.507312 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:38:07.507312 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:38:07.508310 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.509322 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:38:07.509322 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.510852 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.511864 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:38:07.512461 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:38:07.514272 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:38:07.514272 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:38:07.515580 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.516721 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:38:07.517356 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E744F92D50>]}
[0m06:38:07.518159 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 32[0m in 0.02s]
[0m06:38:07.518159 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:38:07.519168 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:38:07.519168 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:38:07.520247 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:38:07.520247 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:38:07.520247 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:38:07.525289 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:38:07.526304 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:38:07.526304 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.527812 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.528506 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:38:07.528506 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:38:07.529550 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.531361 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:38:07.533032 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.535543 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.537554 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:38:07.540125 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:38:07.540641 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:38:07.541227 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:38:07.542739 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.542739 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:38:07.543745 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E744F933B0>]}
[0m06:38:07.543745 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.02s]
[0m06:38:07.544250 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:38:07.544250 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:38:07.545757 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:38:07.547027 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:38:07.547027 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:38:07.548057 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:38:07.554334 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:38:07.554334 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:38:07.555341 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.555341 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.555341 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:38:07.556350 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:38:07.556875 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.556875 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:38:07.558395 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.559972 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.561506 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:38:07.564136 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:38:07.564647 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:38:07.564647 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:38:07.565830 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.566839 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:38:07.567346 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743729280>]}
[0m06:38:07.567346 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.02s]
[0m06:38:07.567996 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:38:07.569009 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:38:07.569519 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:38:07.569519 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:38:07.570525 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:38:07.570525 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:38:07.574048 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:38:07.574048 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:38:07.575559 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.575559 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.575559 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:38:07.577248 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:38:07.577248 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.578776 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:38:07.578776 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.581303 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.582853 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:38:07.583860 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:38:07.585380 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:38:07.585380 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:38:07.586402 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.587910 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:38:07.588805 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7434E3C20>]}
[0m06:38:07.589816 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.02s]
[0m06:38:07.590828 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:38:07.590828 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:38:07.590828 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:38:07.590828 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:38:07.592524 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:38:07.592524 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:38:07.599928 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:38:07.600945 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:38:07.602326 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.603855 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.603855 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:38:07.605531 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:38:07.606546 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.607543 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:38:07.607543 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.611784 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:38:07.612803 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:38:07.615346 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:38:07.615346 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:38:07.615346 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:38:07.617669 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.618286 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:38:07.619299 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7434B9FA0>]}
[0m06:38:07.619299 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.03s]
[0m06:38:07.620395 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:38:07.620395 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:38:07.621389 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:38:07.621389 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:38:07.621389 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:38:07.622387 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:38:07.628067 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:38:07.629784 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:38:07.630803 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.632502 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.633600 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:38:07.633600 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:38:07.633600 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.635688 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:38:07.635688 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.640976 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:38:07.643569 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:38:07.647514 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:38:07.648145 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:38:07.648696 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:38:07.651769 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.653804 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:38:07.653804 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7438F4590>]}
[0m06:38:07.655380 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.03s]
[0m06:38:07.655380 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:38:07.656781 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:38:07.658399 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:38:07.659778 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:38:07.659778 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:38:07.660970 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:38:07.671416 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:38:07.672433 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:38:07.672433 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.673454 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.675451 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:38:07.675972 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:38:07.676989 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.679834 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:38:07.680850 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.685490 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:38:07.686503 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:38:07.689743 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:38:07.689743 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:38:07.690790 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:38:07.692320 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.693524 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:38:07.693524 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7435EF050>]}
[0m06:38:07.694547 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.03s]
[0m06:38:07.694547 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:38:07.695533 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:38:07.696043 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:38:07.696043 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:38:07.696043 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:38:07.697064 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:38:07.700972 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:38:07.700972 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:38:07.700972 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.701977 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.701977 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:38:07.702976 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:38:07.702976 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.704090 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:38:07.704090 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.707246 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:38:07.708265 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:38:07.709905 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:38:07.709905 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:38:07.710922 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:38:07.711433 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.712443 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:38:07.712443 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7435ECFB0>]}
[0m06:38:07.714126 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.02s]
[0m06:38:07.714751 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:38:07.715326 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:38:07.715326 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:38:07.715326 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:38:07.719663 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:38:07.719663 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:38:07.723215 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:38:07.724216 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:38:07.724216 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.724216 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.725206 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:38:07.725206 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:38:07.725724 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.726745 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:38:07.727271 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:38:07.728848 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.728848 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:38:07.730857 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:38:07.730857 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:38:07.730857 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:38:07.732507 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.732507 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:38:07.733517 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E74381DC10>]}
[0m06:38:07.733517 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.02s]
[0m06:38:07.735026 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:38:07.735026 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:38:07.735694 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m06:38:07.735694 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:38:07.736711 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:38:07.744138 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:38:07.745651 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:38:07.760692 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:38:07.762698 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:38:07.762698 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:38:07.763758 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.764777 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.764777 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:38:07.764777 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:07.767018 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.770894 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:38:07.770894 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:38:07.772401 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:38:07.772401 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.04s]
[0m06:38:07.773410 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:38:07.773410 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:38:07.773410 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:38:07.773410 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:38:07.774919 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:38:07.778435 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:38:07.780631 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:38:07.783384 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:38:07.785542 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:38:07.785542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:38:07.786560 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.786560 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.786560 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:38:07.786560 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:38:07.788074 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.789690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:38:07.791212 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:38:07.791212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:38:07.792218 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m06:38:07.792876 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:38:07.793459 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:38:07.793459 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:38:07.793459 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:38:07.794464 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:38:07.801669 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:38:07.802646 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:38:07.803990 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:38:07.805670 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:38:07.805670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:38:07.805670 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.806683 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.806683 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:38:07.806683 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:38:07.812145 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:38:07.813707 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:38:07.816659 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:38:07.817717 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:38:07.819408 [info ] [Thread-1 (]: 24 of 97 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:38:07.820606 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:38:07.820606 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:38:07.822172 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:38:07.823335 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:38:07.823335 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:38:07.829671 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:38:07.830688 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:38:07.834867 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:38:07.835377 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:38:07.836387 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:38:07.836387 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.836387 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.836387 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:38:07.836387 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:38:07.838462 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.840992 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:38:07.842011 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:38:07.842011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:38:07.842564 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m06:38:07.843236 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:38:07.843963 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:38:07.843963 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:38:07.843963 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:38:07.843963 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:38:07.848006 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:38:07.849672 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:38:07.852787 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:38:07.853813 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:38:07.853813 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:38:07.853813 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.853813 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.855767 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:38:07.855767 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:07.856779 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.860938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:38:07.861444 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:38:07.861444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:38:07.862967 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m06:38:07.863478 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:38:07.863478 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:38:07.863478 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:38:07.863478 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:38:07.863478 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:38:07.867829 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:38:07.868988 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:38:07.871001 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:38:07.872004 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:38:07.872004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:38:07.873849 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.874365 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.875376 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:38:07.875376 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:38:07.876894 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.878372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:38:07.880069 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:38:07.880671 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:38:07.881249 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m06:38:07.882269 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:38:07.882781 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:38:07.882781 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:38:07.882781 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:38:07.883791 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:38:07.886986 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:38:07.888504 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:38:07.890805 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:38:07.891313 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:38:07.892320 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:38:07.892320 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.892883 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.893567 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:38:07.894581 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:07.895581 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.897406 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:38:07.897995 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:38:07.897995 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:38:07.897995 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:38:07.899562 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:38:07.899562 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:38:07.900137 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:38:07.901154 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:38:07.901154 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:38:07.904973 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:38:07.906515 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:38:07.910836 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:38:07.912878 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:38:07.912878 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:38:07.913387 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.914987 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:07.915655 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:38:07.916677 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:38:07.919983 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:38:07.924372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:38:07.925377 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:38:07.925377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:38:07.927264 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.03s]
[0m06:38:07.929321 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:38:07.930705 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:38:07.931454 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:38:07.933125 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:38:07.933125 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:38:07.939965 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:38:07.940990 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:38:07.944352 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:38:07.945861 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:38:07.945861 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:38:07.946449 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.947023 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.947023 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:38:07.947023 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:07.948037 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.949669 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:38:07.950312 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:38:07.951008 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:38:07.952021 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:38:07.952021 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:38:07.953023 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:38:07.953023 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:38:07.954041 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:38:07.954041 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:38:07.964165 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:38:07.967184 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:38:07.972856 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:38:07.973868 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:38:07.973868 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:38:07.975379 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.975379 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:07.975379 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:38:07.975379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:07.977804 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.979487 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:38:07.980498 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:38:07.980498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:38:07.981748 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.03s]
[0m06:38:07.982793 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:38:07.982793 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:38:07.983807 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:38:07.985314 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:38:07.985979 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:38:07.989698 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:38:07.991219 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:38:07.994533 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:38:07.996037 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:38:07.996037 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:38:07.996619 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:07.997793 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:07.998946 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:38:08.000085 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.004126 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:38:08.005802 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:38:08.006814 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:38:08.006814 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:38:08.008326 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:38:08.008326 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:38:08.008326 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:38:08.008326 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:38:08.009990 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:38:08.009990 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:38:08.016916 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:38:08.020723 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:38:08.023239 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:38:08.025239 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:38:08.025746 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:38:08.025746 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.026755 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.027393 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:38:08.028410 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.037679 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:38:08.038200 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:38:08.040955 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:38:08.041480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:38:08.041480 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:38:08.042492 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:38:08.042492 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:38:08.042492 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:38:08.044014 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:38:08.044014 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:38:08.047823 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:38:08.048377 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:38:08.052773 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:38:08.053782 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:38:08.053782 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:38:08.055448 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.055448 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.056460 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:38:08.056460 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.057460 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.058969 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:38:08.060137 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:38:08.060711 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:38:08.061289 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:38:08.062376 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:38:08.062376 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:38:08.062903 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:38:08.062903 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:38:08.063912 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:38:08.067692 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:38:08.068259 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:38:08.070502 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:38:08.072013 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:38:08.072013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:38:08.073022 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.073022 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.074021 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:38:08.074021 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.075532 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.078266 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:38:08.078266 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:38:08.078266 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:38:08.079915 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m06:38:08.080929 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:38:08.080929 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:38:08.082118 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:38:08.082118 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:38:08.083131 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:38:08.087748 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:38:08.088334 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:38:08.092454 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:38:08.093473 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:38:08.094524 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:38:08.094524 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.096183 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.096792 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:38:08.097443 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.099621 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:08.101194 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:38:08.102702 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:38:08.102702 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:38:08.102702 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:38:08.104268 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:38:08.104268 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:38:08.104268 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:38:08.105277 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:38:08.105277 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:38:08.110763 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:38:08.112347 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:38:08.114584 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:38:08.116786 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:38:08.116786 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:38:08.117297 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.117952 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.117952 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:38:08.118961 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.126725 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:38:08.127920 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:38:08.129343 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:38:08.129343 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:38:08.129343 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:38:08.130860 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:38:08.131870 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:38:08.131870 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:38:08.132985 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:38:08.132985 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:38:08.135551 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:38:08.136558 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:38:08.138599 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:38:08.139607 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:38:08.140655 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:38:08.140655 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.141162 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.141162 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:38:08.141162 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.142869 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.144486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:38:08.145473 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:38:08.145473 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:38:08.145985 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m06:38:08.146646 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:38:08.146646 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:38:08.147301 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:38:08.147864 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:38:08.147864 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:38:08.153867 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:38:08.155511 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:38:08.157520 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:38:08.159033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:38:08.160043 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:38:08.161075 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.162102 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.162689 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:38:08.162689 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.163697 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.165280 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:38:08.166841 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:38:08.167522 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:38:08.168793 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:38:08.169901 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:38:08.169901 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:38:08.170914 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:38:08.172427 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:38:08.172427 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:38:08.179701 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:38:08.181298 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:38:08.182307 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:38:08.185014 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:38:08.185617 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:38:08.185617 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.186632 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.187631 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:38:08.187631 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.189712 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:08.191229 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:38:08.192831 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:38:08.193420 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:38:08.194432 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:38:08.194432 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:38:08.195429 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:38:08.195937 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:38:08.195937 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:38:08.196511 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:38:08.200909 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:38:08.201921 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:38:08.203952 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:38:08.205555 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:38:08.206563 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:38:08.206563 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.207568 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.207568 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:38:08.208572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.211877 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:38:08.213447 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:38:08.214532 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:38:08.215234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:38:08.215777 [error] [Thread-1 (]: 41 of 97 FAIL 71836 relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[31mFAIL 71836[0m in 0.02s]
[0m06:38:08.216873 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:38:08.216873 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:38:08.217585 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29' to be skipped because of status 'fail'.  Reason: Got 71836 results, configured to fail if != 0.
[0m06:38:08.216873 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:38:08.218228 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:38:08.218228 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:38:08.223213 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:38:08.224208 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:38:08.225717 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:38:08.227353 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:38:08.227353 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:38:08.227353 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.228865 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.228865 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:38:08.229878 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.230913 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.233004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:38:08.234003 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:38:08.234003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:38:08.234003 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.02s]
[0m06:38:08.235002 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:38:08.235577 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:38:08.235577 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:38:08.235577 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:38:08.236586 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:38:08.240718 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:38:08.240718 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:38:08.243490 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:38:08.244501 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:38:08.245503 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:38:08.246012 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.246556 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.247142 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:38:08.247726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.248835 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.250358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:38:08.251622 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:38:08.252165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:38:08.252686 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.02s]
[0m06:38:08.254203 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:38:08.254203 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:38:08.254203 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:38:08.255214 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:38:08.255722 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:38:08.261264 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:38:08.262397 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:38:08.264934 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:38:08.265438 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:38:08.265438 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:38:08.265438 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.267098 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.267098 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:38:08.267098 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.270867 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:38:08.272372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:38:08.273378 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:38:08.273378 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:38:08.273378 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:38:08.274891 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:38:08.274891 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:38:08.275397 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:38:08.275397 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:38:08.275397 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:38:08.279878 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:38:08.280902 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:38:08.283061 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:38:08.284067 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:38:08.284067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:38:08.285063 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.285063 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.285747 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:38:08.285747 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.289917 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:38:08.293481 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:38:08.294473 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:38:08.295470 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:38:08.296473 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:38:08.297474 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:38:08.297474 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:38:08.297474 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:38:08.298476 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:38:08.298476 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:38:08.301469 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:38:08.301469 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:38:08.304995 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:38:08.305995 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:38:08.306993 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:38:08.306993 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.308329 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.308845 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:38:08.308845 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.309858 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.311429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:38:08.312952 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:38:08.312952 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:38:08.313458 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m06:38:08.314121 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:38:08.314121 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:38:08.314869 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:38:08.315456 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:38:08.315456 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:38:08.320080 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:38:08.321074 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:38:08.323584 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:38:08.325159 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:38:08.325159 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:38:08.326176 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.326687 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.327694 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:38:08.327694 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.328204 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.329806 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:38:08.330814 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:38:08.330814 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:38:08.331319 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:38:08.331884 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:38:08.331884 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:38:08.332897 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:38:08.332897 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:38:08.333889 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:38:08.337920 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:38:08.339509 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:38:08.346132 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:38:08.348212 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:38:08.348212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:38:08.349573 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.350112 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.351610 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:38:08.352620 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.360519 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:38:08.362678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:38:08.363700 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:38:08.364715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:38:08.365899 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m06:38:08.365899 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:38:08.367720 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:38:08.368337 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:38:08.368932 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:38:08.368932 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:38:08.377414 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:38:08.378041 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:38:08.379711 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:38:08.381230 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:38:08.381230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:38:08.382254 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.382768 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.382768 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:38:08.382768 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.391109 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:38:08.392117 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:38:08.393051 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:38:08.393556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:38:08.393556 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:38:08.394563 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:38:08.394563 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:38:08.394563 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:38:08.396081 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:38:08.396081 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:38:08.399717 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:38:08.400278 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:38:08.402713 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:38:08.404450 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:38:08.405472 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:38:08.405472 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.405998 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.405998 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:38:08.405998 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.406996 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.408522 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:38:08.410131 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:38:08.410131 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:38:08.410716 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:38:08.411267 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:38:08.411267 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:38:08.411839 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:38:08.411839 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:38:08.411839 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:38:08.415748 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:38:08.417349 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:38:08.421063 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:38:08.422056 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:38:08.422567 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:38:08.422567 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.423591 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.423591 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:38:08.423591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.425105 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.426121 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:38:08.427126 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:38:08.427642 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:38:08.427642 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m06:38:08.428742 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:38:08.428742 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:38:08.430281 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:38:08.430786 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:38:08.431345 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:38:08.434878 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:38:08.435388 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:38:08.438579 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:38:08.439871 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:38:08.439871 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:38:08.439871 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.440877 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.440877 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:38:08.442539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.445839 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:08.446855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:38:08.448054 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:38:08.448054 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:38:08.448054 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:38:08.448054 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:38:08.449635 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:38:08.449635 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:38:08.450291 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:38:08.451306 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:38:08.458395 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:38:08.459975 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:38:08.461776 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:38:08.462800 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:38:08.462800 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:38:08.463310 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.463817 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.465865 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:38:08.467449 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.472360 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:38:08.475084 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:38:08.477611 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:38:08.478119 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:38:08.478119 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:38:08.478119 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:38:08.479896 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:38:08.479896 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:38:08.480911 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:38:08.481426 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:38:08.486478 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:38:08.488503 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:38:08.493423 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:38:08.494432 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:38:08.494432 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:38:08.494432 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.495432 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.495432 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:38:08.495942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.496498 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.497758 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:38:08.499359 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:38:08.499359 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:38:08.499359 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:38:08.500598 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:38:08.501611 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:38:08.501611 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:38:08.501611 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:38:08.502616 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:38:08.505760 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:38:08.506770 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:38:08.508307 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:38:08.510916 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:38:08.510916 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:38:08.511429 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.512511 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.512511 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:38:08.513525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.513525 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.515882 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:38:08.515882 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:38:08.516894 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:38:08.516894 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m06:38:08.517976 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:38:08.517976 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:38:08.517976 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:38:08.519146 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:38:08.519146 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:38:08.523223 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:38:08.524228 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:38:08.525727 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:38:08.528084 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:38:08.528084 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:38:08.528084 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.529649 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.529649 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:38:08.530663 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.533566 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:08.535089 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:38:08.535724 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:38:08.535724 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:38:08.535724 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:38:08.537240 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:38:08.537756 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:38:08.537756 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:38:08.538358 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:38:08.538358 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:38:08.543911 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:38:08.543911 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:38:08.548468 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:38:08.549977 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:38:08.549977 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:38:08.550987 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.550987 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.550987 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:38:08.550987 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.556569 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:38:08.557572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:38:08.558581 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:38:08.558581 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:38:08.560191 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:38:08.560809 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:38:08.562344 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:38:08.562875 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:38:08.562875 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:38:08.563885 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:38:08.566551 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:38:08.569176 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:38:08.574238 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:38:08.577269 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:38:08.577886 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:38:08.577886 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.579492 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.581197 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:38:08.581197 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.583301 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.585424 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:38:08.586439 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:38:08.587435 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:38:08.588690 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.03s]
[0m06:38:08.590814 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:38:08.591329 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:38:08.591329 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:38:08.592334 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:38:08.592334 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:38:08.596082 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:38:08.598063 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:38:08.600242 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:38:08.602781 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:38:08.602781 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:38:08.604787 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.605814 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.606838 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:38:08.607841 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.610031 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.611575 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:38:08.613094 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:38:08.613094 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:38:08.613601 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.02s]
[0m06:38:08.613601 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:38:08.614610 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:38:08.615117 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:38:08.615623 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:38:08.615623 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:38:08.619093 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:38:08.620100 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:38:08.622104 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:38:08.623232 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:38:08.623232 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:38:08.623232 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.624741 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.624741 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:38:08.625261 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.627959 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:38:08.629602 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:38:08.630609 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:38:08.631116 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:38:08.631116 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:38:08.632125 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:38:08.632125 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:38:08.632636 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:38:08.632636 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:38:08.632636 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:38:08.638272 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:38:08.638272 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:38:08.641395 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:38:08.641904 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:38:08.642913 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:38:08.642913 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.643640 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.644651 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:38:08.644651 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:08.654196 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:38:08.654196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:38:08.656341 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:38:08.656341 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:38:08.656341 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:38:08.657353 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:38:08.657353 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:38:08.658358 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:38:08.658358 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:38:08.658358 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:38:08.661822 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:38:08.662400 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:38:08.669045 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:38:08.670061 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:38:08.671055 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:38:08.672055 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.672570 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.673573 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:38:08.673573 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:38:08.675086 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.677111 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:38:08.677726 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:38:08.678349 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.679361 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:38:08.679361 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:38:08.679361 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:38:08.681954 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.683474 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:38:08.683474 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:38:08.685603 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.686610 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:38:08.686610 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E744F258E0>]}
[0m06:38:08.687612 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.03s]
[0m06:38:08.688120 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:38:08.688120 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:38:08.688120 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:38:08.689721 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:38:08.689721 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:38:08.692239 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:38:08.693401 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:38:08.696579 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:38:08.697779 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:38:08.698404 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:38:08.698404 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:08.699416 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.699935 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:38:08.699935 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:38:08.701944 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:08.704023 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:38:08.704023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:38:08.704023 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.705634 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:38:08.705634 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:38:08.706645 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:38:08.708701 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:08.710948 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:38:08.711483 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:38:08.711483 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:08.713503 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:38:08.713503 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E73E9EE810>]}
[0m06:38:09.701504 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:38:09.704570 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m06:38:09.704570 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:38:09.705636 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:38:09.705636 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:38:09.706661 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:38:09.706661 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:38:09.709183 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:38:09.710194 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:38:09.714626 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:38:09.715643 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:38:09.715643 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:38:09.715643 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.717195 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.718214 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:38:09.718214 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:38:09.719236 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.722306 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:38:09.722306 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:38:09.723320 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.724317 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:38:09.724317 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:38:09.724317 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:38:09.725323 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.728740 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:38:09.728740 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:38:09.729758 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.731295 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:38:09.731295 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7435ED4F0>]}
[0m06:38:09.732311 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.02s]
[0m06:38:09.732311 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:38:09.733403 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:38:09.733403 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:38:09.733403 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:38:09.734915 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:38:09.738723 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:38:09.739739 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:38:09.743486 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:38:09.743486 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:38:09.744988 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:38:09.744988 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.746057 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.746057 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:38:09.746662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:38:09.747248 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.753025 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:38:09.754489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:38:09.754970 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.758032 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:38:09.758938 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:38:09.759617 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:38:09.761673 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:09.766691 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:38:09.767202 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:38:09.767768 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.768327 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:38:09.769337 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E744F83C80>]}
[0m06:38:09.770410 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.04s]
[0m06:38:09.770410 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:38:09.770410 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:38:09.771409 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:38:09.771409 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:38:09.772413 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:38:09.773934 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:38:09.775439 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:38:09.782074 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:38:09.784091 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:38:09.785377 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:38:09.786632 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.787628 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.787628 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:38:09.788251 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:38:09.788251 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.796925 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:38:09.798468 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:38:09.800025 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.801041 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:38:09.801041 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:38:09.802559 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:38:09.802559 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.806785 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:38:09.806785 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:38:09.806785 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.808297 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:38:09.809322 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E763A65FD0>]}
[0m06:38:09.809832 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.04s]
[0m06:38:09.810882 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:38:09.810882 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:38:09.811893 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:38:09.812400 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:38:09.812400 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:38:09.814684 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:38:09.816204 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:38:09.819023 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:38:09.820697 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:38:09.820697 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:38:09.822220 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.823252 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.823252 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:38:09.824241 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:38:09.825236 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.828221 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:38:09.828221 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:38:09.828221 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.829819 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:38:09.830831 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:38:09.830831 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:38:09.831898 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.834956 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:38:09.835613 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:38:09.835613 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.836622 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:38:09.837626 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E740A2D460>]}
[0m06:38:09.838134 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.03s]
[0m06:38:09.838134 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:38:09.839697 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:38:09.839697 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:38:09.840716 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:38:09.840716 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:38:09.842931 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:38:09.843492 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:38:09.850082 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:38:09.851101 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:38:09.851101 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:38:09.852612 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.852612 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.854206 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:38:09.854206 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:38:09.854206 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.856951 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:38:09.858467 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:38:09.858467 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.861254 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:38:09.861254 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:38:09.861871 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:38:09.862596 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.865667 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:38:09.866715 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:38:09.867925 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.869455 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:38:09.869455 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E7435EE9F0>]}
[0m06:38:09.870474 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.03s]
[0m06:38:09.870474 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:38:09.871470 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:38:09.871470 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:38:09.872465 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:38:09.872465 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:38:09.875669 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:38:09.875669 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:38:09.879468 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:38:09.882067 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:38:09.882593 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:38:09.883597 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.885116 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.885116 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:38:09.885852 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:38:09.886867 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.889559 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:38:09.889559 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:38:09.889559 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.891248 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:38:09.891248 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:38:09.891248 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:38:09.892376 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.895407 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:38:09.896423 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:38:09.896934 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.898479 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:38:09.898479 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E763A85850>]}
[0m06:38:09.899490 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.03s]
[0m06:38:09.900026 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:38:09.900026 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:38:09.901037 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:38:09.902156 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:38:09.902668 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:38:09.905881 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:38:09.906893 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:38:09.912474 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:38:09.913492 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:38:09.914544 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:38:09.915843 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.917495 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:09.918241 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:38:09.918241 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:38:09.919775 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.923854 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:38:09.923854 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:38:09.925370 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.927094 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:38:09.927094 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:38:09.927094 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:38:09.929688 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.932247 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:38:09.932247 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:38:09.932247 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.934025 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:38:09.934025 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E763A7C6B0>]}
[0m06:38:09.935036 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.03s]
[0m06:38:09.935601 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:38:09.936616 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:38:09.938132 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:38:09.938132 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:38:09.938132 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:38:09.941323 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:38:09.942918 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:38:09.949952 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:38:09.951489 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:38:09.953550 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:38:09.954088 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.954088 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.955694 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:38:09.955694 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:38:09.956706 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.959824 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:38:09.960846 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:38:09.961366 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.962896 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:38:09.962896 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:38:09.963405 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:38:09.965832 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.969200 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:38:09.970218 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:38:09.970218 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.972214 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:38:09.972727 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E74372B4D0>]}
[0m06:38:09.972727 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m06:38:09.974077 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:38:09.974077 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:38:09.974584 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:38:09.975125 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:38:09.975125 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:38:09.980529 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:38:09.982194 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:38:09.985727 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:38:09.986739 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:38:09.986739 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:38:09.987737 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:09.988243 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:09.988243 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:38:09.988243 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:38:09.988243 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:09.989812 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:38:09.991863 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:38:09.992379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:38:09.992891 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.02s]
[0m06:38:09.993585 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:38:09.994222 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:38:09.994744 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:38:09.994744 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:38:09.994744 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:38:10.000160 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:38:10.001169 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:38:10.002689 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:38:10.004292 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:38:10.004292 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:38:10.004292 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.005822 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:10.006830 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:38:10.006830 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:10.008337 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:10.010688 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:38:10.011277 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:38:10.011832 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:38:10.012371 [info ] [Thread-1 (]: 73 of 97 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:38:10.013431 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:38:10.014069 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:38:10.014640 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:38:10.015648 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:38:10.015648 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:38:10.019980 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:38:10.020979 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:38:10.023492 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:38:10.023492 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:38:10.023492 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:38:10.023492 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.025000 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:10.025000 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:38:10.025581 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:38:10.029112 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:38:10.031363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:38:10.032375 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:38:10.032375 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:38:10.033822 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m06:38:10.034824 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:38:10.034824 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:38:10.035336 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:38:10.035336 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:38:10.035336 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:38:10.041504 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:38:10.042644 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:38:10.045672 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:38:10.046555 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:38:10.047119 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:38:10.047119 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.048319 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:10.048319 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:38:10.048319 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:38:10.049918 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:10.050941 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:38:10.050941 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:38:10.051937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:38:10.051937 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.02s]
[0m06:38:10.052931 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:38:10.052931 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:38:10.052931 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:38:10.054101 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:38:10.054101 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:38:10.059049 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:38:10.060056 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:38:10.062955 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:38:10.064549 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:38:10.064549 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:38:10.064549 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.065664 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:10.065664 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:38:10.065664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:10.068967 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:10.070979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:38:10.071978 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:38:10.072485 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:38:10.072485 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.02s]
[0m06:38:10.073498 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:38:10.074919 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:38:10.074919 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:38:10.075431 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:38:10.075431 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:38:10.079593 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:38:10.081113 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:38:10.084267 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:38:10.085363 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:38:10.085363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:38:10.085363 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.086373 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:10.086373 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:38:10.086373 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:38:10.088476 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:10.089557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:38:10.091076 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:38:10.091076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:38:10.092094 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m06:38:10.092601 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:38:10.092601 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:38:10.092601 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:38:10.093612 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:38:10.093612 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:38:10.097989 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:38:10.097989 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:38:10.101235 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:38:10.102746 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:38:10.103759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:38:10.104269 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.104269 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:10.104269 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:38:10.104269 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:38:10.105798 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:10.106808 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:38:10.108324 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:38:10.108324 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:38:10.108324 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:38:10.109926 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:38:10.109926 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:38:10.110937 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:38:10.111554 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:38:10.111554 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:38:10.115858 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:38:10.116869 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:38:10.119455 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:38:10.120469 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:38:10.121462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:38:10.121462 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.121462 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:10.122462 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:38:10.122462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:10.125083 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:10.127094 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:38:10.128278 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:38:10.128278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:38:10.128278 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m06:38:10.128278 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:38:10.129909 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:38:10.129909 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:38:10.130930 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:38:10.130930 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:38:10.134069 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:38:10.134069 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:38:10.136115 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:38:10.138109 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:38:10.138109 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:38:10.138109 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.139715 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:10.139715 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:38:10.139715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:38:10.141239 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:10.143472 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:38:10.145485 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:38:10.145485 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:38:10.145485 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.02s]
[0m06:38:10.146853 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:38:10.146853 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:38:10.147479 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:38:10.148043 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:38:10.148043 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:38:10.151819 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:38:10.152815 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:38:10.158434 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:38:10.160773 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:38:10.160773 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:38:10.161352 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:10.161352 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:10.162374 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:38:10.162374 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:38:17.248396 [debug] [Thread-1 (]: SQL status: OK in 7.086 seconds
[0m06:38:17.250918 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:38:17.250918 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:38:17.251655 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:17.251655 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:38:17.251655 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:38:17.251655 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:38:17.428045 [debug] [Thread-1 (]: SQL status: OK in 0.175 seconds
[0m06:38:17.430829 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:38:17.430829 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:38:17.430829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:17.432479 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:38:17.432479 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743449670>]}
[0m06:38:17.432479 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 7.28s]
[0m06:38:17.433529 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:38:17.433529 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:38:17.433529 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:38:17.435178 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:38:17.435491 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:38:17.437815 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:38:17.438616 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:38:17.441102 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:38:17.442885 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:38:17.443207 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:38:17.443207 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:17.443811 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:17.443811 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:38:17.443811 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:38:17.585656 [debug] [Thread-1 (]: SQL status: OK in 0.141 seconds
[0m06:38:17.588619 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:38:17.588619 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:38:17.589687 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:17.590830 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:38:17.590830 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:38:17.590830 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:38:17.596522 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:38:17.598219 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:38:17.598787 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:38:17.598787 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:17.599799 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:38:17.600427 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E763AE32F0>]}
[0m06:38:17.600427 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.17s]
[0m06:38:17.601505 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:38:17.601505 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:38:17.602074 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:38:17.602634 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:38:17.602634 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:38:17.605961 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:38:17.607029 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:38:17.608603 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:38:17.608603 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:38:17.610332 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:38:17.610332 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:17.610332 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:17.611053 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:38:17.611053 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:38:28.342660 [debug] [Thread-1 (]: SQL status: OK in 10.731 seconds
[0m06:38:28.344230 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:38:28.344230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:38:28.345740 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:28.346327 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:38:28.346327 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:38:28.347347 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:38:28.421086 [debug] [Thread-1 (]: SQL status: OK in 0.073 seconds
[0m06:38:28.422607 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:38:28.424119 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:38:28.425133 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:28.427161 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:38:28.427771 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E743448380>]}
[0m06:38:28.428413 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 10.83s]
[0m06:38:28.429426 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:38:28.429937 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:38:28.430948 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:38:28.430948 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:38:28.431960 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:38:28.434987 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:38:28.435547 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:38:28.438075 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:38:28.438075 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:38:28.439089 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:38:28.439089 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:28.439599 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:28.439599 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:38:28.440130 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:38:28.647134 [debug] [Thread-1 (]: SQL status: OK in 0.207 seconds
[0m06:38:28.649672 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:38:28.649672 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:38:28.650305 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:28.651316 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:38:28.651316 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:38:28.651316 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:38:28.658379 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:38:28.661423 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:38:28.661933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:38:28.661933 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:28.662520 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:38:28.663532 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E763AFB020>]}
[0m06:38:28.664046 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.23s]
[0m06:38:28.664553 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:38:28.664553 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:38:28.665563 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:38:28.666070 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:38:28.666070 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:38:28.668955 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:38:28.668955 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:38:28.670968 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:38:28.672478 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:38:28.672478 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:38:28.672478 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:28.673491 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:28.673491 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:38:28.673491 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:38:28.959925 [debug] [Thread-1 (]: SQL status: OK in 0.285 seconds
[0m06:38:28.961964 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:38:28.962514 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:38:28.962514 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:28.962514 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:38:28.964316 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:38:28.964316 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:38:29.001212 [debug] [Thread-1 (]: SQL status: OK in 0.036 seconds
[0m06:38:29.002737 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:38:29.003750 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:38:29.004266 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.004266 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:38:29.004266 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e3a2d008-5917-4c6f-be63-8f92c7ad8826', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E74391EC30>]}
[0m06:38:29.005777 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.34s]
[0m06:38:29.005777 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:38:29.006790 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:38:29.006790 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:38:29.006790 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:38:29.006790 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:38:29.009944 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:38:29.011467 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:38:29.012598 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:38:29.013610 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:38:29.014125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:38:29.014125 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.014636 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.014636 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:38:29.014636 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.015650 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.016670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:38:29.017824 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:38:29.017824 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:38:29.018472 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:38:29.018472 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:38:29.019108 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:38:29.019108 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:38:29.020123 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:38:29.020123 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:38:29.024169 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:38:29.025169 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:38:29.027198 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:38:29.027893 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:38:29.028306 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:38:29.028900 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.028900 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.029903 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:38:29.030412 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.032499 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:29.033523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:38:29.033523 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:38:29.033523 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:38:29.035043 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m06:38:29.035665 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:38:29.035665 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:38:29.035665 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:38:29.036684 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:38:29.036684 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:38:29.040965 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:38:29.042055 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:38:29.043636 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:38:29.044152 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:38:29.044152 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:38:29.044152 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.045664 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.045664 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:38:29.045664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:38:29.047447 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.049004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:38:29.050006 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:38:29.050522 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:38:29.050522 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m06:38:29.051527 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:38:29.051527 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:38:29.051527 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:38:29.051527 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:38:29.053037 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:38:29.055573 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:38:29.056582 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:38:29.058711 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:38:29.060272 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:38:29.060272 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:38:29.060873 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.061406 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.061406 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:38:29.061922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.062490 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.063500 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:38:29.064015 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:38:29.064525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:38:29.064525 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:38:29.065538 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:38:29.065538 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:38:29.066052 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:38:29.066562 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:38:29.066562 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:38:29.070027 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:38:29.071027 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:38:29.072547 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:38:29.074190 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:38:29.074190 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:38:29.074190 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.075204 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.075714 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:38:29.075714 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.075714 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.077837 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:38:29.078844 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:38:29.078844 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:38:29.079846 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m06:38:29.080359 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:38:29.080869 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:38:29.081886 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:38:29.082398 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:38:29.083403 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:38:29.087435 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:38:29.088603 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:38:29.093385 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:38:29.094398 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:38:29.095395 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:38:29.095905 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.097082 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.097082 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:38:29.097082 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.098598 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.100257 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:38:29.102779 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:38:29.102779 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:38:29.104141 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.02s]
[0m06:38:29.105644 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:38:29.106224 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:38:29.106224 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:38:29.108812 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:38:29.108812 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:38:29.115226 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:38:29.116805 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:38:29.122105 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:38:29.123333 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:38:29.123333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:38:29.123333 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.124343 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.124343 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:38:29.124343 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.125345 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.125345 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:38:29.127256 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:38:29.127256 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:38:29.128282 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.02s]
[0m06:38:29.128282 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:38:29.128282 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:38:29.128282 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:38:29.129972 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:38:29.129972 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:38:29.133686 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:38:29.133686 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:38:29.136437 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:38:29.137977 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:38:29.137977 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:38:29.138640 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.139223 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:38:29.139743 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:38:29.139743 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.140759 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.140759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:38:29.142461 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:38:29.142461 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:38:29.143486 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.01s]
[0m06:38:29.144579 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:38:29.144579 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:38:29.144579 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:38:29.145576 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:38:29.145576 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:38:29.148461 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:38:29.149469 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:38:29.151005 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:38:29.151632 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:38:29.151632 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:38:29.152643 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.153149 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.153149 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:38:29.153149 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.154155 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.155737 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:38:29.156746 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:38:29.156746 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:38:29.156746 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.01s]
[0m06:38:29.158254 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:38:29.158254 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:38:29.158254 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:38:29.158254 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:38:29.158254 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:38:29.163472 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:38:29.163987 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:38:29.166020 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:38:29.167221 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:38:29.167221 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:38:29.167768 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.168315 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.168874 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:38:29.168874 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.171439 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:38:29.172946 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:38:29.173952 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:38:29.173952 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:38:29.173952 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m06:38:29.174951 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:38:29.175457 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:38:29.175457 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:38:29.175457 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:38:29.175457 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:38:29.180934 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:38:29.182486 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:38:29.185644 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:38:29.187655 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:38:29.188163 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:38:29.188163 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.188163 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.189771 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:38:29.189771 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.190788 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.193431 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:38:29.194950 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:38:29.194950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:38:29.195952 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.02s]
[0m06:38:29.196642 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:38:29.197216 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:38:29.197830 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:38:29.198941 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:38:29.207827 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:38:29.222096 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:38:29.223622 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:38:29.227752 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:38:29.229738 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:38:29.230639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:38:29.231220 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:38:29.232440 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.232981 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:38:29.233995 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:38:29.235507 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:38:29.238565 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:38:29.239576 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:38:29.240082 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:38:29.241147 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.04s]
[0m06:38:29.242156 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:38:29.244251 [debug] [MainThread]: Using duckdb connection "master"
[0m06:38:29.244856 [debug] [MainThread]: On master: BEGIN
[0m06:38:29.245385 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:38:29.246582 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:38:29.246582 [debug] [MainThread]: On master: COMMIT
[0m06:38:29.247164 [debug] [MainThread]: Using duckdb connection "master"
[0m06:38:29.247164 [debug] [MainThread]: On master: COMMIT
[0m06:38:29.248183 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:38:29.248693 [debug] [MainThread]: On master: Close
[0m06:38:29.248693 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:38:29.248693 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:38:29.249702 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:38:29.250273 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:38:29.250273 [info ] [MainThread]: 
[0m06:38:29.251288 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 26.65 seconds (26.65s).
[0m06:38:29.264529 [debug] [MainThread]: Command end result
[0m06:38:29.310596 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:38:29.313637 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:38:29.320996 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:38:29.321996 [info ] [MainThread]: 
[0m06:38:29.322500 [info ] [MainThread]: [31mCompleted with 1 error, 0 partial successes, and 0 warnings:[0m
[0m06:38:29.322500 [info ] [MainThread]: 
[0m06:38:29.322500 [error] [MainThread]: [31mFailure in test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_ (models\gold\schema.yml)[0m
[0m06:38:29.323511 [error] [MainThread]:   Got 71836 results, configured to fail if != 0
[0m06:38:29.324107 [info ] [MainThread]: 
[0m06:38:29.324107 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\schema.yml\relationships_fato_carteira_cr_d80151d1e76d6c8de6ceccc7adebe863.sql
[0m06:38:29.324107 [info ] [MainThread]: 
[0m06:38:29.324107 [info ] [MainThread]: Done. PASS=96 WARN=0 ERROR=1 SKIP=0 NO-OP=0 TOTAL=97
[0m06:38:29.325114 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 21 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:38:29.326689 [debug] [MainThread]: Command `dbt build` failed at 06:38:29.326167 after 28.69 seconds
[0m06:38:29.326689 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E74167ACC0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E741C24F80>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001E741C25B20>]}
[0m06:38:29.326689 [debug] [MainThread]: Flushing usage events
[0m06:38:30.070032 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:44:19.906520 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365EA6F920>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365E6E6E70>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365E6E6FF0>]}


============================== 06:44:19.911276 | abb94cd2-865c-4e25-b7ad-8c57e503d161 ==============================
[0m06:44:19.911276 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:44:19.911892 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'fail_fast': 'False', 'debug': 'False', 'log_format': 'default', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'invocation_command': 'dbt build', 'indirect_selection': 'eager', 'use_colors': 'True', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:44:20.175913 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365F084530>]}
[0m06:44:20.266684 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365EC2B440>]}
[0m06:44:20.270586 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:44:20.560990 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:44:20.787582 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed.
[0m06:44:20.788114 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m06:44:21.134185 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_carteira_credito_indexador' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:44:21.134185 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365E6BA060>]}
[0m06:44:21.286935 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:44:21.308630 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660874E00>]}
[0m06:44:21.408567 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:44:21.413823 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:44:21.480578 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660476BD0>]}
[0m06:44:21.481177 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:44:21.489962 [info ] [MainThread]: 
[0m06:44:21.489962 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:44:21.491475 [info ] [MainThread]: 
[0m06:44:21.492619 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:44:21.500164 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:44:21.582276 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:44:21.583390 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:44:21.583390 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:44:21.697011 [debug] [ThreadPool]: SQL status: OK in 0.113 seconds
[0m06:44:21.698014 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:44:21.699050 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:44:21.699577 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:44:21.704351 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:44:21.704351 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:44:21.704351 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:44:21.705381 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:44:21.706561 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:44:21.707583 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:44:21.707583 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:44:21.707583 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:44:21.708577 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:44:21.708577 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:44:21.708577 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:44:21.708577 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:44:21.708577 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:44:21.708577 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:44:21.710359 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:44:21.712581 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:44:21.716618 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:44:21.717244 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:44:21.717244 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:44:21.717839 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:44:21.718426 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:44:21.718426 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:44:21.732226 [debug] [ThreadPool]: SQL status: OK in 0.014 seconds
[0m06:44:21.734233 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:44:21.735233 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:44:21.735740 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:44:21.735740 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660C364B0>]}
[0m06:44:21.736746 [debug] [MainThread]: Using duckdb connection "master"
[0m06:44:21.736746 [debug] [MainThread]: On master: BEGIN
[0m06:44:21.736746 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:44:21.736746 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:44:21.737822 [debug] [MainThread]: On master: COMMIT
[0m06:44:21.737822 [debug] [MainThread]: Using duckdb connection "master"
[0m06:44:21.737822 [debug] [MainThread]: On master: COMMIT
[0m06:44:21.738438 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:44:21.738438 [debug] [MainThread]: On master: Close
[0m06:44:21.743111 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:44:21.744117 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:44:21.744117 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:44:21.744117 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:44:21.758702 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:44:21.761070 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:44:21.786904 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:44:21.788409 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:44:21.789358 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:44:21.789358 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:44:21.790371 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:21.791129 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:44:21.791129 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:44:22.356784 [debug] [Thread-1 (]: SQL status: OK in 0.564 seconds
[0m06:44:22.361895 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:44:22.362495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:44:22.363078 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:22.373641 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:44:22.373641 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:44:22.373641 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:44:22.385502 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:44:22.390744 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:44:22.390744 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:44:22.390744 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:22.394238 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:44:22.397452 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000136608767B0>]}
[0m06:44:22.397452 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.65s]
[0m06:44:22.398128 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:44:22.398128 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:44:22.399737 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:44:22.400271 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:44:22.400271 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:44:22.403835 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:44:22.404338 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:44:22.408350 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:44:22.408856 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:44:22.409862 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:44:22.409862 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:22.410874 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:22.410874 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:44:22.411883 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:44:22.465377 [debug] [Thread-1 (]: SQL status: OK in 0.054 seconds
[0m06:44:22.469174 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:44:22.469174 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:44:22.470900 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:22.473471 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:44:22.473471 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:44:22.473471 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:44:22.475587 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:22.478873 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:44:22.479872 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:44:22.480908 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:22.480908 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:44:22.480908 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660C52630>]}
[0m06:44:22.482667 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.08s]
[0m06:44:22.483679 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:44:22.483679 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:44:22.485879 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:44:22.486545 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:44:22.486545 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:44:22.502503 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:44:22.504092 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:44:22.510067 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:44:22.512708 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:44:22.513801 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:44:22.513801 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:22.515778 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:22.516792 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:44:22.518579 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:44:22.575534 [debug] [Thread-1 (]: SQL status: OK in 0.056 seconds
[0m06:44:22.578377 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:44:22.578377 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:44:22.578377 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:22.579893 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:44:22.580897 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:44:22.580897 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:44:22.582091 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:22.584120 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:44:22.585106 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:44:22.585610 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:22.586630 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:44:22.586630 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F84E390>]}
[0m06:44:22.587616 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m06:44:22.588122 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:44:22.588122 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:44:22.588122 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:44:22.589706 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:44:22.589706 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:44:22.595933 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:44:22.597009 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:44:22.599642 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:44:22.600302 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:44:22.601315 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:44:22.601315 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:22.601315 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:22.601315 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:44:22.602820 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:44:23.260047 [debug] [Thread-1 (]: SQL status: OK in 0.656 seconds
[0m06:44:23.262768 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:44:23.263274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:44:23.263778 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:23.264785 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:44:23.265291 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:44:23.265291 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:44:23.428310 [debug] [Thread-1 (]: SQL status: OK in 0.163 seconds
[0m06:44:23.430903 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:44:23.433517 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:44:23.434283 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:23.435825 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:44:23.436856 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660CEB530>]}
[0m06:44:23.437833 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.85s]
[0m06:44:23.439522 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:44:23.440050 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:44:23.440559 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:44:23.441221 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:44:23.442717 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:44:23.446902 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:44:23.449423 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:44:23.452653 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:44:23.452653 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:44:23.452653 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:44:23.452653 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:23.455090 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:23.455605 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:44:23.455605 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Prudencial')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:44:23.687939 [debug] [Thread-1 (]: SQL status: OK in 0.231 seconds
[0m06:44:23.689651 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:44:23.690685 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:44:23.691220 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:23.692837 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:44:23.692837 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:44:23.693423 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:44:23.706670 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m06:44:23.708182 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:44:23.709761 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:44:23.709761 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:23.711325 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:44:23.711934 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F8942F0>]}
[0m06:44:23.712501 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.27s]
[0m06:44:23.712501 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:44:23.714023 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:44:23.714534 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:44:23.715540 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:44:23.716043 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:44:23.724430 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:44:23.727073 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:44:23.733924 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:44:23.736701 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:44:23.737786 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:44:23.738392 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:23.738392 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:23.740213 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:44:23.741156 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro (SCR)')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:44:23.803989 [debug] [Thread-1 (]: SQL status: OK in 0.062 seconds
[0m06:44:23.806672 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:44:23.806672 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:44:23.807701 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:23.808204 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:44:23.808204 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:44:23.808204 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:44:23.837978 [debug] [Thread-1 (]: SQL status: OK in 0.028 seconds
[0m06:44:23.840078 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:44:23.840582 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:44:23.841235 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:23.842347 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:44:23.843002 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F8940B0>]}
[0m06:44:23.843574 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.13s]
[0m06:44:23.843574 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:44:23.844580 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:44:23.845582 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:44:23.846637 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:44:23.846637 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:44:23.851009 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:44:23.853502 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:44:23.857668 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:44:23.859176 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:44:23.860183 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:44:23.860183 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:23.861925 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:23.862470 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:44:23.863570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:44:23.926945 [debug] [Thread-1 (]: SQL status: OK in 0.062 seconds
[0m06:44:23.928187 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:44:23.929995 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:44:23.931002 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:23.932139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:44:23.932139 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:44:23.932139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:44:24.014464 [debug] [Thread-1 (]: SQL status: OK in 0.082 seconds
[0m06:44:24.016177 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:44:24.016782 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:44:24.017528 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:24.019249 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:44:24.020396 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F88CBF0>]}
[0m06:44:24.021394 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.17s]
[0m06:44:24.021394 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:44:24.022389 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:44:24.022389 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:44:24.022894 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:44:24.023901 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:44:24.028357 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:44:24.030995 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:44:24.040260 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:44:24.042951 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:44:24.043567 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:44:24.043567 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:24.044581 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:24.044581 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:44:24.045573 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:44:24.630444 [debug] [Thread-1 (]: SQL status: OK in 0.584 seconds
[0m06:44:24.633022 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:44:24.633022 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:44:24.634024 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:24.635025 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:44:24.635025 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:44:24.635533 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:44:24.769261 [debug] [Thread-1 (]: SQL status: OK in 0.133 seconds
[0m06:44:24.772018 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:44:24.772018 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:44:24.772560 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:24.773565 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:44:24.773565 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F8C7F80>]}
[0m06:44:24.775068 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.75s]
[0m06:44:24.775068 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:44:24.776073 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:44:24.777074 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:44:24.777578 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:44:24.778158 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:44:24.780767 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:44:24.781289 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:44:24.784816 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:44:24.785320 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:44:24.785895 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:44:24.785895 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:24.787409 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:24.787409 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:44:24.787921 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:44:24.794189 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:44:24.796947 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:44:24.797970 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:44:24.798502 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:24.800111 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:44:24.800111 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:44:24.800111 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:44:24.806495 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:44:24.811884 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:44:24.812506 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:44:24.813513 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:24.816702 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:44:24.818223 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660CCCFE0>]}
[0m06:44:24.819418 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.04s]
[0m06:44:24.820035 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:44:24.821044 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:44:24.821044 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:44:24.822554 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:44:24.823567 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:44:24.829897 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:44:24.831957 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:44:24.836426 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:44:24.838543 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:44:24.838543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:44:24.840318 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:24.841994 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:24.842654 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:44:24.842654 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:44:24.886193 [debug] [Thread-1 (]: SQL status: OK in 0.042 seconds
[0m06:44:24.890964 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:44:24.891495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:44:24.892014 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:24.892655 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:44:24.893666 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:44:24.894170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:44:24.901245 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:44:24.904422 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:44:24.905429 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:44:24.905934 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:24.906940 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:44:24.906940 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F896360>]}
[0m06:44:24.906940 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.08s]
[0m06:44:24.908489 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:44:24.908489 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:44:24.910173 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:44:24.910755 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:44:24.910755 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:44:24.914476 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:44:24.916868 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:44:24.920737 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:44:24.921727 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:44:24.921727 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:44:24.922233 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:24.923243 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:24.923243 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:44:24.923243 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:44:25.235466 [debug] [Thread-1 (]: SQL status: OK in 0.311 seconds
[0m06:44:25.237978 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:44:25.237978 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:44:25.238567 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.240079 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:44:25.240079 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:44:25.240583 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:44:25.411570 [debug] [Thread-1 (]: SQL status: OK in 0.171 seconds
[0m06:44:25.415475 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:44:25.417080 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:44:25.417706 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.418276 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:44:25.418276 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660CFD9A0>]}
[0m06:44:25.419305 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.51s]
[0m06:44:25.419842 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:44:25.419842 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:44:25.420836 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:44:25.420836 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:44:25.422343 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:44:25.423374 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:44:25.447381 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:44:25.447381 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:44:25.447941 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.447941 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.447941 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:44:25.447941 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:44:25.450171 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.463456 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:44:25.464804 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.468481 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:25.475241 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:44:25.478481 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:44:25.479570 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:44:25.480635 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:44:25.483169 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.484186 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:44:25.484186 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660D96E10>]}
[0m06:44:25.485175 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.06s]
[0m06:44:25.485689 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:44:25.486698 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:44:25.487696 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:44:25.488942 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:44:25.488942 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:44:25.488942 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:44:25.494709 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:44:25.494709 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:44:25.495708 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.496292 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.496292 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:44:25.496855 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:44:25.497438 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.497991 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:44:25.497991 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.501184 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.501184 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:44:25.502708 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:44:25.502708 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:44:25.504317 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:44:25.505509 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.506518 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:44:25.507518 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F8F2150>]}
[0m06:44:25.508516 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 32[0m in 0.02s]
[0m06:44:25.508516 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:44:25.508516 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:44:25.508516 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:44:25.508516 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:44:25.510288 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:44:25.510288 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:44:25.515628 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:44:25.516145 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:44:25.516145 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.516666 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.517304 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:44:25.517304 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:44:25.517931 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.519439 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:44:25.519439 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.522601 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:25.523619 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:44:25.527148 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:44:25.527829 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:44:25.527829 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:44:25.531320 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.532877 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:44:25.532877 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F8F3290>]}
[0m06:44:25.533971 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.02s]
[0m06:44:25.534876 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:44:25.535387 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:44:25.536506 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:44:25.538478 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:44:25.538478 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:44:25.538478 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:44:25.544453 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:44:25.545963 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:44:25.547068 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.548588 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.549598 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:44:25.550416 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:44:25.551428 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.551428 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:44:25.551428 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.554016 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.555636 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:44:25.558166 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:44:25.558557 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:44:25.558557 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:44:25.560172 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.560677 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:44:25.561648 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F84D280>]}
[0m06:44:25.563190 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.02s]
[0m06:44:25.563711 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:44:25.563711 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:44:25.564737 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:44:25.565265 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:44:25.565265 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:44:25.565900 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:44:25.570938 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:44:25.570938 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:44:25.570938 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.572446 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.572446 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:44:25.572446 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:44:25.573450 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.573450 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:44:25.575058 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.577062 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.577590 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:44:25.578233 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:44:25.578233 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:44:25.578233 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:44:25.580935 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.581951 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:44:25.582981 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000136607501D0>]}
[0m06:44:25.584056 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.02s]
[0m06:44:25.585465 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:44:25.585465 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:44:25.586474 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:44:25.588609 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:44:25.589628 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:44:25.589628 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:44:25.594215 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:44:25.594215 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:44:25.594215 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.595762 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.595762 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:44:25.596547 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:44:25.597485 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.598185 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:44:25.598185 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.600643 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.601652 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:44:25.604756 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:44:25.605878 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:44:25.605878 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:44:25.606886 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.608481 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:44:25.608481 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660CFCBC0>]}
[0m06:44:25.608481 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.02s]
[0m06:44:25.610145 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:44:25.610722 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:44:25.612381 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:44:25.612889 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:44:25.613909 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:44:25.615428 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:44:25.620816 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:44:25.620816 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:44:25.620816 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.622322 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.622322 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:44:25.623386 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:44:25.623386 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.624449 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:44:25.625433 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.627044 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.628049 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:44:25.629557 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:44:25.631667 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:44:25.632197 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:44:25.633203 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.633203 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:44:25.634302 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660D795E0>]}
[0m06:44:25.634302 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.02s]
[0m06:44:25.635711 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:44:25.635711 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:44:25.636718 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:44:25.637722 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:44:25.638231 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:44:25.638231 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:44:25.646825 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:44:25.647475 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:44:25.647475 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.648258 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.648258 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:44:25.649003 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:44:25.649587 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.650187 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:44:25.651193 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.655355 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:25.655862 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:44:25.658383 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:44:25.660466 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:44:25.660466 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:44:25.662261 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.662873 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:44:25.663497 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660CCCEF0>]}
[0m06:44:25.663497 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.03s]
[0m06:44:25.666946 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:44:25.667456 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:44:25.667456 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:44:25.669040 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:44:25.669040 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:44:25.669040 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:44:25.676083 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:44:25.676083 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:44:25.677084 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.678100 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.678100 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:44:25.678664 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:44:25.678664 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.680803 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:44:25.681465 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.684207 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.685205 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:44:25.687727 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:44:25.688235 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:44:25.688235 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:44:25.689993 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.691000 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:44:25.692011 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F894200>]}
[0m06:44:25.692570 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.02s]
[0m06:44:25.693190 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:44:25.694200 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:44:25.694200 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:44:25.695708 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:44:25.695708 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:44:25.696343 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:44:25.698430 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:44:25.699463 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:44:25.699980 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.701011 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.701011 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:44:25.701011 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:44:25.702541 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.702541 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:44:25.702541 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:44:25.705839 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.705839 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:44:25.709899 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:44:25.710926 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:44:25.711458 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:44:25.712638 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.713642 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:44:25.715228 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660CCF860>]}
[0m06:44:25.715876 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.02s]
[0m06:44:25.716904 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:44:25.718015 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:44:25.718015 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m06:44:25.719022 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:44:25.719527 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:44:25.731439 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:44:25.733290 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:44:25.751996 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:44:25.753524 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:44:25.754046 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:44:25.754046 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.755767 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.755767 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:44:25.755767 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:25.756795 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.758319 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:44:25.759867 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:44:25.759867 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:44:25.760881 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.04s]
[0m06:44:25.762016 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:44:25.762016 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:44:25.762522 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:44:25.763528 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:44:25.763528 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:44:25.766646 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:44:25.767763 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:44:25.770841 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:44:25.772348 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:44:25.773353 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:44:25.773353 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.773353 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.774352 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:44:25.774352 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:44:25.775354 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:25.777030 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:44:25.778074 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:44:25.778074 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:44:25.778074 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:44:25.779834 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:44:25.779834 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:44:25.779834 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:44:25.780841 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:44:25.780841 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:44:25.791951 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:44:25.792558 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:44:25.795592 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:44:25.797363 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:44:25.797926 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:44:25.798535 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.799549 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.800235 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:44:25.800235 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:44:25.807381 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:44:25.808905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:44:25.810934 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:44:25.812139 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:44:25.812747 [info ] [Thread-1 (]: 24 of 97 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.03s]
[0m06:44:25.812747 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:44:25.813760 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:44:25.813760 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:44:25.814819 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:44:25.815454 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:44:25.821308 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:44:25.822858 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:44:25.823852 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:44:25.825374 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:44:25.825374 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:44:25.825374 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.826969 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.827559 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:44:25.827559 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:44:25.828180 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.829726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:44:25.831239 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:44:25.831239 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:44:25.832800 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m06:44:25.832800 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:44:25.833796 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:44:25.833796 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:44:25.835301 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:44:25.835301 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:44:25.839718 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:44:25.842209 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:44:25.844469 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:44:25.846593 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:44:25.847145 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:44:25.848299 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.848299 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.848299 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:44:25.849905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:25.850919 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.854570 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:44:25.855595 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:44:25.855595 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:44:25.856626 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m06:44:25.856626 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:44:25.857610 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:44:25.857610 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:44:25.858609 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:44:25.858609 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:44:25.861584 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:44:25.862604 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:44:25.864700 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:44:25.865844 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:44:25.867362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:44:25.867362 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.868881 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.868881 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:44:25.868881 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:44:25.872930 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:44:25.875483 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:44:25.877990 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:44:25.877990 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:44:25.877990 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m06:44:25.879539 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:44:25.879539 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:44:25.880549 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:44:25.881057 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:44:25.882583 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:44:25.885783 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:44:25.887305 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:44:25.890104 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:44:25.890686 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:44:25.890686 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:44:25.890686 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.892383 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.893130 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:44:25.893130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:25.893646 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.896165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:44:25.897320 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:44:25.897911 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:44:25.898516 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:44:25.898516 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:44:25.899520 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:44:25.899520 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:44:25.900077 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:44:25.900077 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:44:25.904331 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:44:25.905364 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:44:25.910845 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:44:25.912729 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:44:25.913750 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:44:25.913750 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.913750 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.914843 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:44:25.914843 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:44:25.917056 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:25.918301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:44:25.918867 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:44:25.919875 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:44:25.919875 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m06:44:25.920874 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:44:25.920874 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:44:25.920874 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:44:25.922920 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:44:25.922920 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:44:25.927000 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:44:25.928400 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:44:25.930780 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:44:25.932019 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:44:25.932019 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:44:25.933031 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.933031 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.934041 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:44:25.935036 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:25.936565 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.938112 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:44:25.939811 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:44:25.940838 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:44:25.941370 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:44:25.942378 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:44:25.942378 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:44:25.943406 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:44:25.943944 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:44:25.943944 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:44:25.948511 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:44:25.950041 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:44:25.954126 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:44:25.956733 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:44:25.956733 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:44:25.956733 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.958805 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.958805 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:44:25.959819 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:25.961373 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.964945 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:44:25.966972 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:44:25.966972 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:44:25.968006 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m06:44:25.969246 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:44:25.970261 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:44:25.972255 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:44:25.973779 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:44:25.973779 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:44:25.984005 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:44:25.986024 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:44:25.990851 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:44:25.994010 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:44:25.994010 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:44:25.995524 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:25.996148 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:25.996790 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:44:25.997363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.002533 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:44:26.005690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:44:26.006696 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:44:26.006696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:44:26.008216 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.04s]
[0m06:44:26.008216 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:44:26.009791 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:44:26.009791 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:44:26.011440 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:44:26.011991 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:44:26.017894 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:44:26.019995 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:44:26.023517 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:44:26.025022 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:44:26.025613 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:44:26.025613 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.025613 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.027169 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:44:26.027832 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.038138 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:44:26.040736 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:44:26.041266 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:44:26.042288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:44:26.042288 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:44:26.042865 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:44:26.043457 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:44:26.043457 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:44:26.043457 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:44:26.044489 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:44:26.049335 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:44:26.050349 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:44:26.102566 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:44:26.104113 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:44:26.104113 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:44:26.104113 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.105686 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.105686 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:44:26.106716 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.106716 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.108244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:44:26.108244 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:44:26.109839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:44:26.109839 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.07s]
[0m06:44:26.110855 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:44:26.110855 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:44:26.110855 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:44:26.112236 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:44:26.112794 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:44:26.115806 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:44:26.115806 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:44:26.118953 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:44:26.119964 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:44:26.119964 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:44:26.119964 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.120974 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.121973 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:44:26.121973 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.122478 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.123486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:44:26.124993 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:44:26.125593 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:44:26.125593 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:44:26.127167 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:44:26.127167 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:44:26.127765 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:44:26.128345 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:44:26.128345 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:44:26.131880 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:44:26.132942 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:44:26.135495 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:44:26.136514 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:44:26.137509 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:44:26.137509 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.138075 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.138075 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:44:26.138075 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.141144 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:26.143207 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:44:26.144213 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:44:26.144213 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:44:26.145719 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:44:26.146291 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:44:26.146879 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:44:26.147436 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:44:26.147978 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:44:26.147978 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:44:26.152610 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:44:26.154224 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:44:26.157248 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:44:26.158248 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:44:26.158248 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:44:26.158248 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.158248 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.159816 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:44:26.159816 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.165407 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:44:26.166980 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:44:26.167985 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:44:26.168487 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:44:26.168991 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:44:26.168991 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:44:26.170000 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:44:26.170000 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:44:26.170998 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:44:26.170998 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:44:26.174129 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:44:26.175634 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:44:26.178671 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:44:26.179680 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:44:26.180693 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:44:26.181201 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.182212 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.182721 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:44:26.182721 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.183731 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.183731 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:44:26.185344 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:44:26.186350 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:44:26.186350 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.02s]
[0m06:44:26.187857 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:44:26.188479 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:44:26.188479 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:44:26.189488 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:44:26.190508 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:44:26.193216 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:44:26.194223 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:44:26.196290 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:44:26.196909 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:44:26.196909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:44:26.196909 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.197917 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.198424 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:44:26.198424 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.199946 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.200959 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:44:26.201970 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:44:26.202967 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:44:26.203472 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:44:26.203976 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:44:26.203976 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:44:26.203976 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:44:26.203976 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:44:26.205535 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:44:26.208559 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:44:26.210764 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:44:26.213465 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:44:26.214628 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:44:26.216156 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:44:26.216665 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.217312 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.217985 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:44:26.217985 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.220652 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:26.222201 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:44:26.223730 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:44:26.223730 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:44:26.223730 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:44:26.225258 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:44:26.225258 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:44:26.225258 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:44:26.225258 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:44:26.225258 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:44:26.229868 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:44:26.231424 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:44:26.232969 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:44:26.235447 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:44:26.236477 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:44:26.236477 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.237991 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.238673 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:44:26.238673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.243616 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:44:26.244163 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:44:26.245694 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:44:26.246245 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:44:26.246245 [info ] [Thread-1 (]: 41 of 97 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:44:26.246787 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:44:26.247357 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:44:26.247917 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:44:26.248528 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:44:26.250046 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:44:26.252564 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:44:26.254125 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:44:26.256754 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:44:26.258260 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:44:26.258260 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:44:26.258260 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.259776 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.259776 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:44:26.259776 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.261344 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.264657 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:44:26.265689 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:44:26.266223 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:44:26.266747 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.02s]
[0m06:44:26.267394 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:44:26.267964 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:44:26.267964 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:44:26.268987 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:44:26.270120 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:44:26.276215 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:44:26.277919 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:44:26.285163 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:44:26.285756 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:44:26.286762 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:44:26.288275 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.289921 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.289921 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:44:26.291052 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.291599 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.292696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:44:26.293307 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:44:26.294319 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:44:26.295337 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.03s]
[0m06:44:26.296777 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:44:26.297426 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:44:26.298021 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:44:26.298021 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:44:26.299645 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:44:26.305527 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:44:26.307105 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:44:26.310308 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:44:26.311931 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:44:26.312436 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:44:26.312436 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.312436 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.313440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:44:26.313961 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.317081 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:26.320480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:44:26.323051 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:44:26.324049 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:44:26.324049 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m06:44:26.325084 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:44:26.326204 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:44:26.326713 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:44:26.328301 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:44:26.328301 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:44:26.335109 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:44:26.337741 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:44:26.341416 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:44:26.342478 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:44:26.342478 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:44:26.344002 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.344002 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.345512 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:44:26.345512 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.350046 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:26.351076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:44:26.351076 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:44:26.352601 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:44:26.352601 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:44:26.352601 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:44:26.354131 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:44:26.354131 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:44:26.354131 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:44:26.355672 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:44:26.358187 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:44:26.359811 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:44:26.362461 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:44:26.364027 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:44:26.364534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:44:26.364534 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.364534 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.365538 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:44:26.365538 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.367680 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.369343 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:44:26.369875 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:44:26.369875 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:44:26.369875 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.02s]
[0m06:44:26.370887 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:44:26.370887 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:44:26.370887 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:44:26.370887 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:44:26.372395 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:44:26.375421 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:44:26.377019 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:44:26.379598 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:44:26.381119 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:44:26.382130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:44:26.382130 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.382637 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.383646 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:44:26.383646 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.385154 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.386750 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:44:26.388263 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:44:26.388263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:44:26.388263 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:44:26.390881 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:44:26.390881 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:44:26.391992 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:44:26.392578 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:44:26.392578 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:44:26.404349 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:44:26.404349 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:44:26.408452 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:44:26.410114 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:44:26.410114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:44:26.411122 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.412466 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.412466 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:44:26.413473 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.417774 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:44:26.419101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:44:26.420129 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:44:26.420129 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:44:26.421114 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m06:44:26.422113 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:44:26.422634 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:44:26.423645 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:44:26.423645 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:44:26.423645 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:44:26.429786 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:44:26.431967 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:44:26.435063 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:44:26.435748 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:44:26.436766 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:44:26.437783 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.438477 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.438477 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:44:26.439487 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.449929 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:44:26.450937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:44:26.451937 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:44:26.451937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:44:26.452937 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:44:26.454552 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:44:26.454552 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:44:26.455586 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:44:26.456603 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:44:26.456603 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:44:26.461403 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:44:26.462440 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:44:26.465555 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:44:26.467125 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:44:26.467125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:44:26.467125 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.467852 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.469109 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:44:26.470125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.471129 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.472638 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:44:26.473655 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:44:26.475169 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:44:26.475169 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:44:26.476179 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:44:26.476179 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:44:26.477180 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:44:26.477777 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:44:26.478338 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:44:26.481254 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:44:26.482801 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:44:26.485987 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:44:26.488305 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:44:26.488305 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:44:26.488305 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.490939 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.491460 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:44:26.491975 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.492640 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.494773 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:44:26.496325 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:44:26.496850 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:44:26.497474 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m06:44:26.498045 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:44:26.498045 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:44:26.498045 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:44:26.499636 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:44:26.500229 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:44:26.506777 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:44:26.509872 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:44:26.513876 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:44:26.514886 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:44:26.515626 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:44:26.515626 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.516634 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.516634 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:44:26.517141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.518933 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.520452 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:44:26.520452 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:44:26.521957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:44:26.521957 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:44:26.522985 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:44:26.522985 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:44:26.522985 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:44:26.523964 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:44:26.524991 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:44:26.529693 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:44:26.530706 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:44:26.535943 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:44:26.536953 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:44:26.537951 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:44:26.537951 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.539626 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.540671 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:44:26.541191 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.544352 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:26.548501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:44:26.551547 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:44:26.553070 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:44:26.554088 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:44:26.554088 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:44:26.554088 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:44:26.555693 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:44:26.555693 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:44:26.556723 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:44:26.560876 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:44:26.561978 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:44:26.565316 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:44:26.565931 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:44:26.565931 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:44:26.566934 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.567518 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.568080 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:44:26.568080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.569093 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.570145 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:44:26.571145 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:44:26.572144 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:44:26.572678 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:44:26.572678 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:44:26.572678 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:44:26.573674 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:44:26.573674 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:44:26.575180 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:44:26.578093 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:44:26.579769 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:44:26.582446 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:44:26.583457 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:44:26.583457 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:44:26.583457 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.584964 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.584964 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:44:26.585970 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.585970 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.588190 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:44:26.590833 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:44:26.591341 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:44:26.592350 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m06:44:26.593604 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:44:26.593604 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:44:26.594626 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:44:26.594626 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:44:26.595608 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:44:26.599972 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:44:26.601014 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:44:26.604051 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:44:26.606687 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:44:26.606687 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:44:26.606687 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.607705 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.608213 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:44:26.608213 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.611858 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:26.613956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:44:26.615564 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:44:26.615564 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:44:26.616575 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:44:26.617804 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:44:26.618600 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:44:26.619216 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:44:26.619216 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:44:26.620246 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:44:26.628005 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:44:26.629017 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:44:26.631034 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:44:26.632597 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:44:26.632597 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:44:26.632597 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.633591 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.633591 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:44:26.633591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.638198 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:26.641331 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:44:26.642945 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:44:26.643549 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:44:26.644555 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:44:26.646679 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:44:26.647345 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:44:26.648036 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:44:26.648036 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:44:26.648036 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:44:26.652710 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:44:26.655362 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:44:26.658714 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:44:26.660600 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:44:26.661652 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:44:26.661652 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.662657 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.662657 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:44:26.662657 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.664607 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.667954 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:44:26.668979 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:44:26.668979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:44:26.670054 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.02s]
[0m06:44:26.671054 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:44:26.672498 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:44:26.672498 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:44:26.673504 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:44:26.673504 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:44:26.677229 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:44:26.677808 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:44:26.679937 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:44:26.680957 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:44:26.681975 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:44:26.681975 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.682478 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.682478 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:44:26.682478 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.683481 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.684986 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:44:26.685571 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:44:26.686605 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:44:26.687581 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:44:26.688102 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:44:26.689775 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:44:26.689775 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:44:26.690784 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:44:26.690784 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:44:26.696117 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:44:26.697630 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:44:26.700319 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:44:26.701334 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:44:26.702842 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:44:26.702842 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.703854 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.705390 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:44:26.705390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.710218 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:44:26.710894 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:44:26.712431 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:44:26.712431 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:44:26.712431 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:44:26.714583 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:44:26.715593 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:44:26.716737 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:44:26.717874 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:44:26.717874 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:44:26.723548 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:44:26.725054 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:44:26.727571 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:44:26.729737 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:44:26.730758 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:44:26.731411 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.732017 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.733027 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:44:26.733027 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:26.746725 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m06:44:26.747904 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:44:26.749471 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:44:26.750684 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:44:26.750684 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:44:26.752537 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:44:26.752537 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:44:26.752537 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:44:26.754183 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:44:26.754183 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:44:26.759866 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:44:26.760880 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:44:26.763950 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:44:26.765486 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:44:26.765486 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:44:26.765486 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.766514 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.766514 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:44:26.767102 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:44:26.767702 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.770321 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:44:26.771362 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:44:26.772329 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.773426 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:44:26.773426 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:44:26.774425 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:44:26.777253 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:26.779425 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:44:26.779958 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:44:26.779958 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:26.780981 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:44:26.780981 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660CFCE60>]}
[0m06:44:26.782012 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.03s]
[0m06:44:26.782012 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:44:26.783077 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:44:26.783077 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:44:26.784076 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:44:26.784076 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:44:26.786642 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:44:26.786642 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:44:26.789781 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:44:26.790872 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:44:26.791540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:44:26.791540 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:26.793072 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.793580 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:44:26.793580 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:44:26.794591 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.797291 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:44:26.797866 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:44:26.798530 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.800061 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:44:26.800061 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:44:26.801089 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:44:26.801089 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.802598 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:44:26.804204 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:44:26.804204 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:26.807327 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:44:26.808358 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000136608A11C0>]}
[0m06:44:27.658355 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:44:27.661435 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m06:44:27.662688 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:44:27.662688 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:44:27.663693 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:44:27.663693 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:44:27.663693 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:44:27.667760 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:44:27.668974 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:44:27.675650 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:44:27.675650 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:44:27.675650 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:44:27.675650 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.677413 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.677413 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:44:27.678060 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:44:27.678060 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.681135 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:44:27.681135 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:44:27.682163 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.683258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:44:27.683258 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:44:27.683258 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:44:27.688216 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:44:27.689863 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:44:27.690972 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:44:27.691511 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.692555 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:44:27.692555 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013600FDB200>]}
[0m06:44:27.693565 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:44:27.694936 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:44:27.695445 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:44:27.696016 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:44:27.696016 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:44:27.696591 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:44:27.698715 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:44:27.699727 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:44:27.704003 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:44:27.705541 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:44:27.705541 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:44:27.706546 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.706546 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.706546 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:44:27.707547 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:44:27.708561 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.710936 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:44:27.710936 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:44:27.711947 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.712467 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:44:27.712467 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:44:27.712467 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:44:27.714540 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.717904 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:44:27.718931 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:44:27.718931 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.720096 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:44:27.721096 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F8BC080>]}
[0m06:44:27.721096 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.02s]
[0m06:44:27.722114 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:44:27.722114 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:44:27.722114 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:44:27.723741 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:44:27.723741 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:44:27.725271 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:44:27.726874 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:44:27.731097 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:44:27.732129 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:44:27.732669 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:44:27.732669 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.733664 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.733664 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:44:27.733664 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:44:27.735172 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.738323 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:44:27.738323 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:44:27.739941 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.740986 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:44:27.740986 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:44:27.740986 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:44:27.743583 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.746186 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:44:27.746186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:44:27.746829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.747389 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:44:27.747988 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F8920F0>]}
[0m06:44:27.747988 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.03s]
[0m06:44:27.750196 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:44:27.750196 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:44:27.751209 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:44:27.752726 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:44:27.754382 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:44:27.758458 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:44:27.760122 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:44:27.766034 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:44:27.767576 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:44:27.769224 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:44:27.769734 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.772265 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:27.773278 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:44:27.773278 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:44:27.775778 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.781148 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:44:27.782172 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:44:27.783702 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.785876 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:44:27.785876 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:44:27.785876 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:44:27.787402 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.790035 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:44:27.791046 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:44:27.793576 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.795614 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:44:27.796072 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660725EB0>]}
[0m06:44:27.796577 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.04s]
[0m06:44:27.798639 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:44:27.799657 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:44:27.800321 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:44:27.801344 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:44:27.802851 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:44:27.808583 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:44:27.810749 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:44:27.815533 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:44:27.818262 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:44:27.819791 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:44:27.820802 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.822315 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:27.823889 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:44:27.823889 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:44:27.825394 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.835671 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:44:27.836700 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:44:27.837683 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.838731 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:44:27.838731 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:44:27.838731 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:44:27.839759 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.842660 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:44:27.842660 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:44:27.843672 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.844808 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:44:27.845313 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F8D9520>]}
[0m06:44:27.845313 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.04s]
[0m06:44:27.846320 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:44:27.846847 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:44:27.848125 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:44:27.848125 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:44:27.848125 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:44:27.851386 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:44:27.851386 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:44:27.857506 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:44:27.860041 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:44:27.860613 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:44:27.861233 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.862472 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.862472 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:44:27.863479 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:44:27.865554 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.869439 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:44:27.869439 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:44:27.870943 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.872474 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:44:27.872474 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:44:27.872474 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:44:27.873468 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.876692 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:44:27.877198 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:44:27.877768 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.878340 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:44:27.878340 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013601001520>]}
[0m06:44:27.879988 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.03s]
[0m06:44:27.880996 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:44:27.882115 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:44:27.882115 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:44:27.883121 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:44:27.883121 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:44:27.885659 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:44:27.886684 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:44:27.890937 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:44:27.891977 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:44:27.891977 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:44:27.892570 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.892570 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.893584 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:44:27.893584 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:44:27.895540 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.899703 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:44:27.899703 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:44:27.900325 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.901349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:44:27.902873 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:44:27.902873 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:44:27.904444 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.906983 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:44:27.906983 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:44:27.908493 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.911779 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:44:27.912284 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001360103C050>]}
[0m06:44:27.912857 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.03s]
[0m06:44:27.913863 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:44:27.913863 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:44:27.913863 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:44:27.915080 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:44:27.915080 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:44:27.918297 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:44:27.918297 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:44:27.920816 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:44:27.922634 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:44:27.923330 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:44:27.923330 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.924348 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.925332 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:44:27.925841 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:44:27.926848 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.930899 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:44:27.931924 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:44:27.931924 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.933026 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:44:27.934055 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:44:27.934055 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:44:27.935038 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.938618 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:44:27.939627 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:44:27.940130 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.941373 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:44:27.941373 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001360103E7B0>]}
[0m06:44:27.941988 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m06:44:27.942554 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:44:27.942554 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:44:27.943568 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:44:27.944678 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:44:27.945694 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:44:27.947952 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:44:27.949516 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:44:27.953017 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:44:27.955545 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:44:27.957631 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:44:27.958156 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.958673 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.958673 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:44:27.960341 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:44:27.960948 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:27.961525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:44:27.962554 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:44:27.962554 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:44:27.963693 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.02s]
[0m06:44:27.964725 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:44:27.965735 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:44:27.966744 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:44:27.967319 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:44:27.967319 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:44:27.972659 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:44:27.973672 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:44:27.976775 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:44:27.978948 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:44:27.979973 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:44:27.980507 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:27.981029 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:27.981029 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:44:27.982058 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:27.983600 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:27.985688 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:44:27.988217 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:44:27.988217 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:44:27.989921 [info ] [Thread-1 (]: 73 of 97 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:44:27.990929 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:44:27.990929 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:44:27.992765 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:44:27.993978 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:44:27.993978 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:44:28.002581 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:44:28.004443 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:44:28.008478 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:44:28.010041 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:44:28.011049 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:44:28.011049 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:28.011554 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.012572 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:44:28.013625 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:44:28.020018 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:44:28.023544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:44:28.023544 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:44:28.025068 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:44:28.026087 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.03s]
[0m06:44:28.027595 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:44:28.028240 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:44:28.028240 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:44:28.029854 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:44:28.029854 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:44:28.034052 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:44:28.035553 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:44:28.039756 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:44:28.040789 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:44:28.040789 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:44:28.042426 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:28.043449 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.043983 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:44:28.043983 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:44:28.045486 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.046625 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:44:28.048363 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:44:28.048363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:44:28.050009 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.02s]
[0m06:44:28.051019 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:44:28.052022 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:44:28.053017 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:44:28.053017 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:44:28.053017 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:44:28.062494 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:44:28.064558 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:44:28.067333 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:44:28.070064 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:44:28.071065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:44:28.071065 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:28.073286 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.073286 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:44:28.073286 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:28.077012 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:28.078847 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:44:28.080361 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:44:28.080361 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:44:28.080866 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.03s]
[0m06:44:28.081872 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:44:28.081872 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:44:28.083275 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:44:28.083275 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:44:28.083275 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:44:28.086400 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:44:28.088495 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:44:28.092578 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:44:28.093771 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:44:28.093771 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:44:28.093771 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:28.093771 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:28.095294 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:44:28.095294 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:44:28.098433 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:28.100112 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:44:28.101141 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:44:28.101141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:44:28.102650 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m06:44:28.104245 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:44:28.105930 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:44:28.105930 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:44:28.106943 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:44:28.106943 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:44:28.112615 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:44:28.114169 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:44:28.119041 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:44:28.121213 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:44:28.121213 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:44:28.121213 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:28.122212 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:28.122212 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:44:28.122212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:44:28.124223 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.125231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:44:28.127173 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:44:28.128186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:44:28.128716 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.02s]
[0m06:44:28.128716 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:44:28.129724 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:44:28.130730 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:44:28.131236 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:44:28.131236 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:44:28.138745 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:44:28.140782 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:44:28.144554 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:44:28.146656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:44:28.147227 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:44:28.147841 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:28.148412 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.149419 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:44:28.149419 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:28.152552 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:44:28.156621 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:44:28.157607 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:44:28.159125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:44:28.160810 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.03s]
[0m06:44:28.162952 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:44:28.163535 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:44:28.164556 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:44:28.165575 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:44:28.166592 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:44:28.175206 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:44:28.177231 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:44:28.180405 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:44:28.180910 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:44:28.181920 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:44:28.182431 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:28.183444 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.183444 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:44:28.183444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:44:28.185882 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.189599 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:44:28.189599 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:44:28.191087 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:44:28.191087 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.03s]
[0m06:44:28.192092 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:44:28.192596 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:44:28.192596 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:44:28.193606 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:44:28.194738 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:44:28.198098 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:44:28.198098 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:44:28.202967 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:44:28.203977 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:44:28.203977 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:44:28.203977 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:28.205575 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:28.205575 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:44:28.205575 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:44:36.581180 [debug] [Thread-1 (]: SQL status: OK in 8.374 seconds
[0m06:44:36.584356 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:44:36.584881 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:44:36.585502 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:36.586532 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:44:36.586532 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:44:36.586532 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:44:36.737993 [debug] [Thread-1 (]: SQL status: OK in 0.150 seconds
[0m06:44:36.740227 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:44:36.740227 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:44:36.740731 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:36.740731 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:44:36.742339 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001367F86D580>]}
[0m06:44:36.742973 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 8.55s]
[0m06:44:36.744108 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:44:36.744108 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:44:36.744108 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:44:36.745660 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:44:36.746314 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:44:36.748489 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:44:36.750132 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:44:36.756591 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:44:36.757589 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:44:36.758593 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:44:36.758593 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:36.760266 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:36.760923 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:44:36.760923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:44:36.935508 [debug] [Thread-1 (]: SQL status: OK in 0.174 seconds
[0m06:44:36.938781 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:44:36.938781 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:44:36.939806 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:36.940974 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:44:36.940974 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:44:36.940974 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:44:36.950983 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:44:36.953047 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:44:36.953047 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:44:36.954069 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:36.954069 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:44:36.955678 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660CC2720>]}
[0m06:44:36.955678 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.21s]
[0m06:44:36.956688 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:44:36.956688 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:44:36.958193 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:44:36.958193 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:44:36.958193 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:44:36.962427 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:44:36.962427 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:44:36.969627 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:44:36.973160 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:44:36.974157 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:44:36.974157 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:36.975678 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:36.975678 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:44:36.975678 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:44:52.237672 [debug] [Thread-1 (]: SQL status: OK in 15.260 seconds
[0m06:44:52.240851 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:44:52.240851 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:44:52.241865 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:52.244546 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:44:52.244546 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:44:52.245548 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:44:52.293433 [debug] [Thread-1 (]: SQL status: OK in 0.048 seconds
[0m06:44:52.297089 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:44:52.298121 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:44:52.298121 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:52.300250 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:44:52.301280 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013600FEBDA0>]}
[0m06:44:52.301280 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 15.34s]
[0m06:44:52.302789 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:44:52.303386 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:44:52.303906 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:44:52.303906 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:44:52.305448 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:44:52.311035 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:44:52.312669 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:44:52.317930 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:44:52.320068 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:44:52.320068 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:44:52.320068 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:52.321096 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:52.321096 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:44:52.322084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:44:52.626242 [debug] [Thread-1 (]: SQL status: OK in 0.303 seconds
[0m06:44:52.629559 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:44:52.629559 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:44:52.631416 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:52.633367 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:44:52.633367 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:44:52.633367 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:44:52.647558 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m06:44:52.649928 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:44:52.651038 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:44:52.652045 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:52.653664 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:44:52.654269 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001360106FE00>]}
[0m06:44:52.654269 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.35s]
[0m06:44:52.656022 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:44:52.656022 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:44:52.657084 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:44:52.657084 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:44:52.658638 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:44:52.660919 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:44:52.662239 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:44:52.665153 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:44:52.666819 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:44:52.666819 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:44:52.667323 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:52.667323 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:52.667323 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:44:52.667323 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:44:53.140817 [debug] [Thread-1 (]: SQL status: OK in 0.472 seconds
[0m06:44:53.143676 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:44:53.143676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:44:53.144682 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.145684 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:44:53.146925 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:44:53.146925 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:44:53.205986 [debug] [Thread-1 (]: SQL status: OK in 0.058 seconds
[0m06:44:53.208511 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:44:53.208511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:44:53.210840 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.212474 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:44:53.212474 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'abb94cd2-865c-4e25-b7ad-8c57e503d161', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000013660987DA0>]}
[0m06:44:53.214032 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.56s]
[0m06:44:53.214552 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:44:53.214552 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:44:53.215557 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:44:53.216583 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:44:53.216583 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:44:53.221656 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:44:53.222201 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:44:53.225715 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:44:53.227396 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:44:53.227396 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:44:53.227995 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.227995 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.227995 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:44:53.227995 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.229724 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.232301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:44:53.233848 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:44:53.233848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:44:53.234847 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.02s]
[0m06:44:53.235369 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:44:53.236382 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:44:53.237015 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:44:53.237523 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:44:53.238546 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:44:53.246047 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:44:53.247382 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:44:53.253011 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:44:53.254190 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:44:53.254190 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:44:53.254190 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.255798 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.255798 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:44:53.255798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.258351 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:53.258351 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:44:53.260672 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:44:53.261296 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:44:53.261975 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m06:44:53.262513 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:44:53.262513 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:44:53.264051 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:44:53.264555 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:44:53.265562 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:44:53.271893 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:44:53.272436 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:44:53.275594 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:44:53.278124 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:44:53.278124 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:44:53.279693 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.279693 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.280717 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:44:53.280717 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:44:53.282304 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:53.284926 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:44:53.286165 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:44:53.286165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:44:53.286165 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m06:44:53.288301 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:44:53.288301 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:44:53.290893 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:44:53.291404 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:44:53.291404 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:44:53.296519 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:44:53.298075 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:44:53.300760 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:44:53.302767 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:44:53.302767 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:44:53.303893 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.303893 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.305486 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:44:53.305486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.306543 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.309000 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:44:53.310005 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:44:53.311013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:44:53.311519 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:44:53.313030 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:44:53.314543 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:44:53.314543 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:44:53.316530 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:44:53.317121 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:44:53.323006 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:44:53.325511 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:44:53.329589 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:44:53.331733 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:44:53.331733 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:44:53.332274 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.333290 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.334797 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:44:53.335402 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.337432 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.339603 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:44:53.341095 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:44:53.341095 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:44:53.342127 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.03s]
[0m06:44:53.343442 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:44:53.343442 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:44:53.343442 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:44:53.344470 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:44:53.344470 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:44:53.347875 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:44:53.348991 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:44:53.351100 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:44:53.351100 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:44:53.352606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:44:53.352606 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.352606 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.354224 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:44:53.354224 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.354224 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.355892 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:44:53.356906 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:44:53.356906 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:44:53.358432 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.01s]
[0m06:44:53.358432 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:44:53.360065 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:44:53.361078 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:44:53.361580 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:44:53.361580 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:44:53.368376 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:44:53.370001 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:44:53.372504 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:44:53.373508 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:44:53.373508 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:44:53.373508 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.373508 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.373508 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:44:53.375011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.375610 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.375610 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:44:53.377173 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:44:53.377173 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:44:53.378177 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.02s]
[0m06:44:53.379687 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:44:53.380716 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:44:53.382232 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:44:53.383337 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:44:53.383337 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:44:53.389629 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:44:53.390904 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:44:53.396023 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:44:53.397137 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:44:53.398250 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:44:53.400819 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.402819 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:44:53.403859 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:44:53.405368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.406378 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.408390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:44:53.408390 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:44:53.408390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:44:53.408390 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.03s]
[0m06:44:53.410605 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:44:53.410605 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:44:53.411640 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:44:53.413756 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:44:53.416971 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:44:53.420720 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:44:53.422224 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:44:53.423730 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:44:53.425901 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:44:53.426927 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:44:53.427469 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.428031 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.428031 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:44:53.428031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.428031 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.430588 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:44:53.431143 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:44:53.431143 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:44:53.431143 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.02s]
[0m06:44:53.432146 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:44:53.432146 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:44:53.433175 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:44:53.434175 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:44:53.436684 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:44:53.444319 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:44:53.445319 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:44:53.447916 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:44:53.449993 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:44:53.450541 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:44:53.450925 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.451431 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.451431 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:44:53.453020 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.459766 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:44:53.462283 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:44:53.462883 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:44:53.462883 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:44:53.463912 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.03s]
[0m06:44:53.464484 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:44:53.464484 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:44:53.464484 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:44:53.465513 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:44:53.465513 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:44:53.472121 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:44:53.472625 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:44:53.476693 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:44:53.478344 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:44:53.478344 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:44:53.479363 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.479363 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:44:53.479363 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:44:53.480945 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.480945 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.481973 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:44:53.483069 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:44:53.483069 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:44:53.484052 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.02s]
[0m06:44:53.484052 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:44:53.485051 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:44:53.485646 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:44:53.485646 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:44:53.486650 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:44:53.490286 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:44:53.490793 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:44:53.493879 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:44:53.493879 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:44:53.493879 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:44:53.495385 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:44:53.495385 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.496390 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:44:53.496390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:44:53.496894 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:44:53.498405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:44:53.498405 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:44:53.498405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:44:53.500054 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m06:44:53.501059 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:44:53.502565 [debug] [MainThread]: Using duckdb connection "master"
[0m06:44:53.502565 [debug] [MainThread]: On master: BEGIN
[0m06:44:53.502565 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:44:53.504188 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:44:53.504188 [debug] [MainThread]: On master: COMMIT
[0m06:44:53.505004 [debug] [MainThread]: Using duckdb connection "master"
[0m06:44:53.505004 [debug] [MainThread]: On master: COMMIT
[0m06:44:53.505536 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:44:53.506059 [debug] [MainThread]: On master: Close
[0m06:44:53.506612 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:44:53.506612 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:44:53.507726 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:44:53.508243 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:44:53.508243 [info ] [MainThread]: 
[0m06:44:53.509352 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 32.02 seconds (32.02s).
[0m06:44:53.525407 [debug] [MainThread]: Command end result
[0m06:44:53.557642 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:44:53.558642 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:44:53.567106 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:44:53.567106 [info ] [MainThread]: 
[0m06:44:53.568353 [info ] [MainThread]: [32mCompleted successfully[0m
[0m06:44:53.568896 [info ] [MainThread]: 
[0m06:44:53.568896 [info ] [MainThread]: Done. PASS=97 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=97
[0m06:44:53.569903 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 2 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:44:53.570917 [debug] [MainThread]: Command `dbt build` succeeded at 06:44:53.570917 after 33.81 seconds
[0m06:44:53.570917 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365EF67AA0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365B0422D0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001365E71D550>]}
[0m06:44:53.570917 [debug] [MainThread]: Flushing usage events
[0m06:44:54.358360 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:54:49.747093 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F2331970>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F5644B00>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F5644410>]}


============================== 06:54:49.751268 | c618d88b-53fd-4ad0-a4f7-646c9a45edf0 ==============================
[0m06:54:49.751268 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:54:49.752771 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'invocation_command': 'dbt build', 'use_colors': 'True', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:54:49.936487 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F4A87BF0>]}
[0m06:54:49.985516 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F52A1FA0>]}
[0m06:54:49.988131 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:54:50.193463 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:54:50.355317 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
[0m06:54:50.355317 [debug] [MainThread]: Nothing changed, skipping partial parsing.
[0m06:54:50.356331 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing
[0m06:54:50.361477 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:54:50.398445 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F6D99F70>]}
[0m06:54:50.474056 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:54:50.477244 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:54:50.572349 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F6FC3CB0>]}
[0m06:54:50.572349 [info ] [MainThread]: Found 26 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:54:50.578425 [info ] [MainThread]: 
[0m06:54:50.578425 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:54:50.579431 [info ] [MainThread]: 
[0m06:54:50.579431 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:54:50.584302 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:54:50.662601 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:54:50.662601 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:54:50.662601 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:54:51.167946 [debug] [ThreadPool]: SQL status: OK in 0.505 seconds
[0m06:54:51.168951 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:54:51.170126 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:54:51.170126 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:54:51.175205 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:54:51.175205 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:54:51.176815 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:54:51.177364 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:54:51.177890 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:54:51.177890 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:54:51.177890 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:54:51.179495 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:54:51.179495 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:54:51.179495 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:54:51.180498 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:54:51.181001 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:54:51.181001 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:54:51.181001 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:54:51.182004 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:54:51.184085 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:54:51.188216 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:54:51.188216 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:54:51.188216 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:54:51.188216 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:54:51.189869 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:54:51.189869 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:54:51.201018 [debug] [ThreadPool]: SQL status: OK in 0.011 seconds
[0m06:54:51.201018 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:54:51.202549 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:54:51.202549 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:54:51.204146 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F715EFF0>]}
[0m06:54:51.204146 [debug] [MainThread]: Using duckdb connection "master"
[0m06:54:51.204146 [debug] [MainThread]: On master: BEGIN
[0m06:54:51.204146 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:54:51.205769 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:54:51.205769 [debug] [MainThread]: On master: COMMIT
[0m06:54:51.205769 [debug] [MainThread]: Using duckdb connection "master"
[0m06:54:51.205769 [debug] [MainThread]: On master: COMMIT
[0m06:54:51.205769 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:54:51.206776 [debug] [MainThread]: On master: Close
[0m06:54:51.211911 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:54:51.211911 [info ] [Thread-1 (]: 1 of 97 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:54:51.212571 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:54:51.212571 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:54:51.227284 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:54:51.227839 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:54:51.250488 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:54:51.251013 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:54:51.251013 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:54:51.251013 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:54:51.252545 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:51.252545 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:54:51.252545 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:54:51.754279 [debug] [Thread-1 (]: SQL status: OK in 0.500 seconds
[0m06:54:51.758910 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:54:51.758910 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:54:51.759916 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:51.768816 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:54:51.769823 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:54:51.769823 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:54:51.779790 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:54:51.783877 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:54:51.783877 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:54:51.785381 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:51.786389 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:54:51.789086 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F6D98BC0>]}
[0m06:54:51.789596 [info ] [Thread-1 (]: 1 of 97 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.57s]
[0m06:54:51.790600 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:54:51.790600 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:54:51.791103 [info ] [Thread-1 (]: 2 of 97 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:54:51.791103 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:54:51.792126 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:54:51.795736 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:54:51.796843 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:54:51.798157 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:54:51.800451 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:54:51.800451 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:54:51.800451 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:51.801459 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:51.801459 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:54:51.801459 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:54:51.850886 [debug] [Thread-1 (]: SQL status: OK in 0.049 seconds
[0m06:54:51.855559 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:54:51.855559 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:54:51.856571 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:51.857570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:54:51.857570 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:54:51.858593 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:54:51.860372 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:51.862682 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:54:51.862682 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:54:51.863216 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:51.863722 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:54:51.864746 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F7623770>]}
[0m06:54:51.865252 [info ] [Thread-1 (]: 2 of 97 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.07s]
[0m06:54:51.865867 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:54:51.866950 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:54:51.868088 [info ] [Thread-1 (]: 3 of 97 START sql table model main.dim_tempo ................................... [RUN]
[0m06:54:51.869223 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:54:51.870252 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:54:51.886673 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:54:51.888180 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:54:51.890814 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:54:51.890814 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:54:51.892581 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:54:51.892581 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:51.892581 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:51.893606 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:54:51.893606 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:54:51.942119 [debug] [Thread-1 (]: SQL status: OK in 0.048 seconds
[0m06:54:51.944816 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:54:51.944816 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:54:51.945342 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:51.946375 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:54:51.946896 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:54:51.946896 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:54:51.948411 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:51.950075 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:54:51.950075 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:54:51.951113 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:51.951113 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:54:51.952642 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F7544530>]}
[0m06:54:51.952642 [info ] [Thread-1 (]: 3 of 97 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.08s]
[0m06:54:51.952642 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:54:51.952642 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:54:51.954253 [info ] [Thread-1 (]: 4 of 97 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:54:51.954253 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:54:51.955257 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:54:51.961045 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:54:51.961750 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:54:51.963774 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:54:51.965282 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:54:51.965282 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:54:51.965845 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:51.965845 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:51.965845 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:54:51.966850 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:54:52.539744 [debug] [Thread-1 (]: SQL status: OK in 0.573 seconds
[0m06:54:52.543629 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:54:52.544833 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:54:52.544833 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:52.546378 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:54:52.546900 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:54:52.546900 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:54:52.670485 [debug] [Thread-1 (]: SQL status: OK in 0.124 seconds
[0m06:54:52.672481 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:54:52.673015 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:54:52.673015 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:52.674025 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:54:52.675024 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F761D010>]}
[0m06:54:52.675024 [info ] [Thread-1 (]: 4 of 97 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.72s]
[0m06:54:52.675545 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:54:52.675545 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:54:52.675545 [info ] [Thread-1 (]: 5 of 97 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:54:52.677128 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:54:52.677128 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:54:52.680280 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:54:52.680785 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:54:52.682910 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:54:52.683911 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:54:52.683911 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:54:52.683911 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:52.684911 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:52.685417 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:54:52.685417 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Prudencial')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:54:52.845725 [debug] [Thread-1 (]: SQL status: OK in 0.160 seconds
[0m06:54:52.847962 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:54:52.848607 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:54:52.848607 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:52.850230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:54:52.850230 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:54:52.850230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:54:52.860664 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:54:52.862920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:54:52.862920 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:54:52.863468 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:52.864617 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:54:52.864617 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F75D32F0>]}
[0m06:54:52.865622 [info ] [Thread-1 (]: 5 of 97 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.19s]
[0m06:54:52.865622 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:54:52.865622 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:54:52.866972 [info ] [Thread-1 (]: 6 of 97 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:54:52.867503 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:54:52.867503 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:54:52.870182 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:54:52.871163 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:54:52.873707 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:54:52.875228 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:54:52.875228 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:54:52.875228 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:52.875228 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:52.876784 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:54:52.876784 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro (SCR)')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:54:52.918436 [debug] [Thread-1 (]: SQL status: OK in 0.041 seconds
[0m06:54:52.920956 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:54:52.920956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:54:52.921962 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:52.922466 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:54:52.923472 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:54:52.923472 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:54:52.948513 [debug] [Thread-1 (]: SQL status: OK in 0.025 seconds
[0m06:54:52.951142 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:54:52.951142 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:54:52.952671 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:52.954288 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:54:52.954288 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F7667830>]}
[0m06:54:52.955321 [info ] [Thread-1 (]: 6 of 97 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.09s]
[0m06:54:52.955321 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:54:52.956394 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:54:52.956394 [info ] [Thread-1 (]: 7 of 97 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:54:52.957394 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:54:52.957394 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:54:52.961303 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:54:52.961932 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:54:52.963471 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:54:52.964565 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:54:52.965650 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:54:52.965650 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:52.965650 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:52.965650 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:54:52.965650 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:54:53.014748 [debug] [Thread-1 (]: SQL status: OK in 0.047 seconds
[0m06:54:53.017026 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:54:53.017026 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:54:53.017628 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:53.018222 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:54:53.019225 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:54:53.019225 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:54:53.082494 [debug] [Thread-1 (]: SQL status: OK in 0.063 seconds
[0m06:54:53.083500 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:54:53.085011 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:54:53.085683 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:53.086689 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:54:53.086689 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F763D460>]}
[0m06:54:53.087689 [info ] [Thread-1 (]: 7 of 97 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.13s]
[0m06:54:53.088196 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:54:53.088708 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:54:53.088708 [info ] [Thread-1 (]: 8 of 97 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:54:53.089714 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:54:53.089714 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:54:53.094142 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:54:53.094142 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:54:53.097998 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:54:53.099559 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:54:53.100203 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:54:53.100203 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:53.101213 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:53.102721 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:54:53.104411 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:54:53.658339 [debug] [Thread-1 (]: SQL status: OK in 0.553 seconds
[0m06:54:53.662478 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:54:53.662983 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:54:53.663495 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:53.664502 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:54:53.665007 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:54:53.665007 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:54:53.774119 [debug] [Thread-1 (]: SQL status: OK in 0.109 seconds
[0m06:54:53.775623 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:54:53.775623 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:54:53.775623 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:53.777762 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:54:53.777762 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897B85160>]}
[0m06:54:53.778840 [info ] [Thread-1 (]: 8 of 97 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.69s]
[0m06:54:53.778840 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:54:53.778840 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:54:53.779844 [info ] [Thread-1 (]: 9 of 97 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:54:53.780850 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:54:53.780850 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:54:53.783271 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:54:53.783271 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:54:53.786910 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:54:53.788054 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:54:53.788054 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:54:53.788702 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:53.788702 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:53.788702 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:54:53.789715 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:54:53.794344 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:54:53.796994 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:54:53.796994 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:54:53.798004 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:53.798004 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:54:53.798004 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:54:53.798004 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:54:53.802662 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:54:53.803839 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:54:53.803839 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:54:53.805367 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:53.806403 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:54:53.807374 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F75EB7D0>]}
[0m06:54:53.807374 [info ] [Thread-1 (]: 9 of 97 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.03s]
[0m06:54:53.808395 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:54:53.808395 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:54:53.808395 [info ] [Thread-1 (]: 10 of 97 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:54:53.810008 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:54:53.810008 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:54:53.813030 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:54:53.814540 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:54:53.817777 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:54:53.818444 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:54:53.819073 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:54:53.819073 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:53.820084 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:53.820084 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:54:53.820084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:54:53.851118 [debug] [Thread-1 (]: SQL status: OK in 0.031 seconds
[0m06:54:53.854221 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:54:53.854221 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:54:53.855853 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:53.858393 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:54:53.858393 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:54:53.858393 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:54:53.864998 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:54:53.865526 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:54:53.867133 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:54:53.867133 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:53.868155 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:54:53.868155 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897B9AD20>]}
[0m06:54:53.869301 [info ] [Thread-1 (]: 10 of 97 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.06s]
[0m06:54:53.869845 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:54:53.869845 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:54:53.869845 [info ] [Thread-1 (]: 11 of 97 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:54:53.870851 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:54:53.870851 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:54:53.874421 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:54:53.875423 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:54:53.877677 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:54:53.878283 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:54:53.878283 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:54:53.878283 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:53.880021 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:53.880629 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:54:53.880629 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:54:54.132823 [debug] [Thread-1 (]: SQL status: OK in 0.252 seconds
[0m06:54:54.134942 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:54:54.134942 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:54:54.136235 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.136235 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:54:54.136235 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:54:54.136235 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:54:54.283324 [debug] [Thread-1 (]: SQL status: OK in 0.146 seconds
[0m06:54:54.285403 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:54:54.286418 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:54:54.286418 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.287972 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:54:54.287972 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F4A87530>]}
[0m06:54:54.288649 [info ] [Thread-1 (]: 11 of 97 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.42s]
[0m06:54:54.288649 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:54:54.289653 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:54:54.290156 [info ] [Thread-1 (]: 12 of 97 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:54:54.290660 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:54:54.290660 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:54:54.291190 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:54:54.308552 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:54:54.308552 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:54:54.308552 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.310193 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.310193 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:54:54.310193 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:54:54.310738 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.319284 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:54:54.319284 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.325345 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:54:54.329830 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:54:54.330928 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:54:54.330928 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:54:54.332367 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:54:54.334382 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.334382 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:54:54.335380 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F7545310>]}
[0m06:54:54.335380 [info ] [Thread-1 (]: 12 of 97 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.04s]
[0m06:54:54.336426 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:54:54.336426 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:54:54.336426 [info ] [Thread-1 (]: 13 of 97 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:54:54.337425 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:54:54.337929 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:54:54.337929 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:54:54.341866 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:54:54.341866 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:54:54.341866 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.343240 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.343240 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:54:54.343240 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:54:54.344246 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.345766 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:54:54.346373 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.346987 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.347998 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:54:54.349538 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:54:54.350094 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:54:54.350094 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:54:54.351105 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.351105 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:54:54.351105 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F761B2F0>]}
[0m06:54:54.352614 [info ] [Thread-1 (]: 13 of 97 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 32[0m in 0.01s]
[0m06:54:54.352614 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:54:54.352614 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:54:54.354330 [info ] [Thread-1 (]: 14 of 97 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:54:54.354330 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:54:54.354330 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:54:54.355347 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:54:54.358411 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:54:54.358411 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:54:54.358411 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.360052 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.360052 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:54:54.360052 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:54:54.361065 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.361901 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:54:54.361901 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.362958 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.363964 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:54:54.365475 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:54:54.365475 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:54:54.365475 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:54:54.365475 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.367955 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:54:54.367955 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897BCEE10>]}
[0m06:54:54.368963 [info ] [Thread-1 (]: 14 of 97 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.01s]
[0m06:54:54.369468 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:54:54.369468 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:54:54.369468 [info ] [Thread-1 (]: 15 of 97 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:54:54.370473 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:54:54.371496 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:54:54.371496 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:54:54.375042 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:54:54.375042 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:54:54.375552 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.375552 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.375552 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:54:54.375552 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:54:54.377058 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.378070 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:54:54.378070 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.379890 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.379890 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:54:54.381898 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:54:54.381898 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:54:54.382431 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:54:54.383424 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.383424 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:54:54.384928 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897BBBE90>]}
[0m06:54:54.384928 [info ] [Thread-1 (]: 15 of 97 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.01s]
[0m06:54:54.385520 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:54:54.385520 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:54:54.386528 [info ] [Thread-1 (]: 16 of 97 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:54:54.386528 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:54:54.387530 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:54:54.387530 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:54:54.390855 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:54:54.390855 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:54:54.390855 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.391866 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.392371 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:54:54.392371 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:54:54.392371 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.393879 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:54:54.393879 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.395885 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.396391 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:54:54.397964 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:54:54.397964 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:54:54.398470 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:54:54.399474 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.400643 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:54:54.400643 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F75F9BB0>]}
[0m06:54:54.401669 [info ] [Thread-1 (]: 16 of 97 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.01s]
[0m06:54:54.401669 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:54:54.402651 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:54:54.402651 [info ] [Thread-1 (]: 17 of 97 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:54:54.402651 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:54:54.402651 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:54:54.402651 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:54:54.406487 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:54:54.407465 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:54:54.407465 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.407465 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.408464 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:54:54.408464 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:54:54.408464 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.410081 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:54:54.410081 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.412702 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:54.413230 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:54:54.413736 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:54:54.414762 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:54:54.415267 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:54:54.415797 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.416803 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:54:54.417309 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F6D98FB0>]}
[0m06:54:54.417309 [info ] [Thread-1 (]: 17 of 97 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.01s]
[0m06:54:54.417992 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:54:54.417992 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:54:54.418996 [info ] [Thread-1 (]: 18 of 97 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:54:54.418996 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:54:54.418996 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:54:54.418996 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:54:54.423081 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:54:54.423081 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:54:54.423081 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.424080 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.424080 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:54:54.424080 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:54:54.425603 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.425603 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:54:54.425603 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.428364 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.428364 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:54:54.430406 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:54:54.430406 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:54:54.430406 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:54:54.432154 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.433160 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:54:54.434168 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F752D730>]}
[0m06:54:54.434168 [info ] [Thread-1 (]: 18 of 97 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.02s]
[0m06:54:54.435675 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:54:54.436682 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:54:54.436682 [info ] [Thread-1 (]: 19 of 97 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:54:54.436682 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:54:54.437681 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:54:54.438203 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:54:54.441228 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:54:54.441228 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:54:54.441228 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.442232 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.442232 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:54:54.442802 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:54:54.442802 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.444420 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:54:54.445425 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.447255 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:54.447810 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:54:54.449893 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:54:54.449893 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:54:54.449893 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:54:54.451185 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.451185 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:54:54.452192 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F75ED640>]}
[0m06:54:54.452192 [info ] [Thread-1 (]: 19 of 97 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.01s]
[0m06:54:54.452698 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:54:54.452698 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:54:54.453704 [info ] [Thread-1 (]: 20 of 97 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:54:54.453704 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:54:54.453704 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:54:54.453704 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:54:54.457040 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:54:54.457040 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:54:54.457040 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.458547 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.458547 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:54:54.458547 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:54:54.460104 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.461112 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:54:54.461112 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.463128 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.463633 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:54:54.464640 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:54:54.465145 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:54:54.465145 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:54:54.465691 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.466697 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:54:54.467203 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F75DC230>]}
[0m06:54:54.467822 [info ] [Thread-1 (]: 20 of 97 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.01s]
[0m06:54:54.467822 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:54:54.468450 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:54:54.469057 [info ] [Thread-1 (]: 21 of 97 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:54:54.469057 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:54:54.469057 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:54:54.470064 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:54:54.473577 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:54:54.475083 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:54:54.475083 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.475083 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.476090 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:54:54.476090 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:54:54.476090 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.477644 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:54:54.477644 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:54:54.478175 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.479749 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:54:54.481257 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:54:54.481767 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:54:54.481767 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:54:54.482772 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.483772 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:54:54.483772 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F75DC1A0>]}
[0m06:54:54.483772 [info ] [Thread-1 (]: 21 of 97 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.01s]
[0m06:54:54.485276 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:54:54.485276 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:54:54.485899 [info ] [Thread-1 (]: 22 of 97 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m06:54:54.485899 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:54:54.485899 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:54:54.495591 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:54:54.496709 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:54:54.508472 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:54:54.508472 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:54:54.510052 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:54:54.510052 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.510634 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.510634 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:54:54.511211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.511781 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.514244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:54:54.514765 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:54:54.514765 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:54:54.515818 [info ] [Thread-1 (]: 22 of 97 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.03s]
[0m06:54:54.515818 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:54:54.516829 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:54:54.516829 [info ] [Thread-1 (]: 23 of 97 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:54:54.517536 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:54:54.517536 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:54:54.520313 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:54:54.521306 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:54:54.523376 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:54:54.524359 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:54:54.524359 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:54:54.524359 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.525359 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.525359 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:54:54.525359 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.525359 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.527043 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:54:54.528288 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:54:54.528288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:54:54.528797 [info ] [Thread-1 (]: 23 of 97 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:54:54.528797 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:54:54.529800 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:54:54.530317 [info ] [Thread-1 (]: 24 of 97 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:54:54.530830 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:54:54.530830 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:54:54.536646 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:54:54.537645 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:54:54.538152 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:54:54.539745 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:54:54.539745 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:54:54.539745 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.540752 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.541258 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:54:54.541258 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:54:54.546483 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:54:54.548049 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:54:54.548554 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:54:54.549560 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:54:54.550276 [info ] [Thread-1 (]: 24 of 97 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:54:54.550276 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:54:54.551290 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:54:54.551290 [info ] [Thread-1 (]: 25 of 97 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:54:54.551290 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:54:54.551290 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:54:54.553843 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:54:54.556610 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:54:54.558610 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:54:54.560706 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:54:54.560706 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:54:54.561296 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.561849 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.562378 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:54:54.562378 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.562378 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.564703 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:54:54.565281 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:54:54.565886 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:54:54.565886 [info ] [Thread-1 (]: 25 of 97 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:54:54.566891 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:54:54.566891 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:54:54.568288 [info ] [Thread-1 (]: 26 of 97 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:54:54.569296 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:54:54.569839 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:54:54.575451 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:54:54.577003 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:54:54.578083 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:54:54.580843 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:54:54.581351 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:54:54.581351 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.581351 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.581351 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:54:54.582371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.583386 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.585586 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:54:54.586594 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:54:54.586594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:54:54.587590 [info ] [Thread-1 (]: 26 of 97 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m06:54:54.588093 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:54:54.588093 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:54:54.588093 [info ] [Thread-1 (]: 27 of 97 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:54:54.588093 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:54:54.589717 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:54:54.593521 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:54:54.595545 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:54:54.597280 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:54:54.597947 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:54:54.597947 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:54:54.597947 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.597947 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.599531 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:54:54.599531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:54:54.601083 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:54.602612 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:54:54.602612 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:54:54.602612 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:54:54.602612 [info ] [Thread-1 (]: 27 of 97 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.01s]
[0m06:54:54.604404 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:54:54.604404 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:54:54.604404 [info ] [Thread-1 (]: 28 of 97 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:54:54.606122 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:54:54.606122 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:54:54.611836 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:54:54.612889 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:54:54.614480 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:54:54.615747 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:54:54.616754 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:54:54.617259 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.617259 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.617827 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:54:54.617827 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.618421 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.619097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:54:54.620104 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:54:54.620104 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:54:54.621105 [info ] [Thread-1 (]: 28 of 97 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:54:54.622118 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:54:54.622118 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:54:54.623123 [info ] [Thread-1 (]: 29 of 97 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:54:54.624125 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:54:54.625157 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:54:54.631061 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:54:54.634185 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:54:54.640779 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:54:54.644572 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:54:54.645571 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:54:54.646721 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.647966 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.649549 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:54:54.650334 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:54:54.653899 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:54:54.656503 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:54:54.657502 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:54:54.657502 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:54:54.659005 [info ] [Thread-1 (]: 29 of 97 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.03s]
[0m06:54:54.660014 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:54:54.660014 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:54:54.661022 [info ] [Thread-1 (]: 30 of 97 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:54:54.661022 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:54:54.662319 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:54:54.667071 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:54:54.668586 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:54:54.671100 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:54:54.672608 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:54:54.672608 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:54:54.673615 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.673615 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.673615 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:54:54.673615 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.676133 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.677646 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:54:54.678376 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:54:54.679385 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:54:54.679891 [info ] [Thread-1 (]: 30 of 97 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:54:54.679891 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:54:54.680895 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:54:54.680895 [info ] [Thread-1 (]: 31 of 97 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:54:54.680895 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:54:54.680895 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:54:54.683588 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:54:54.685718 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:54:54.686725 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:54:54.688230 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:54:54.688230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:54:54.688230 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.688230 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.689756 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:54:54.689756 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.690767 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.692441 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:54:54.692441 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:54:54.693462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:54:54.693462 [info ] [Thread-1 (]: 31 of 97 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m06:54:54.693997 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:54:54.693997 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:54:54.693997 [info ] [Thread-1 (]: 32 of 97 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:54:54.695559 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:54:54.695559 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:54:54.700232 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:54:54.701242 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:54:54.702751 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:54:54.704264 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:54:54.704264 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:54:54.704264 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.705270 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.705270 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:54:54.705270 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.708813 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:54:54.710368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:54:54.710891 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:54:54.710891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:54:54.711902 [info ] [Thread-1 (]: 32 of 97 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:54:54.712405 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:54:54.713410 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:54:54.713410 [info ] [Thread-1 (]: 33 of 97 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:54:54.713915 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:54:54.713915 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:54:54.717938 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:54:54.718967 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:54:54.721096 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:54:54.722618 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:54:54.722618 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:54:54.722618 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.723622 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.723622 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:54:54.723622 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.732426 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:54:54.733432 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:54:54.733432 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:54:54.734934 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:54:54.734934 [info ] [Thread-1 (]: 33 of 97 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:54:54.735939 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:54:54.736444 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:54:54.736444 [info ] [Thread-1 (]: 34 of 97 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:54:54.738289 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:54:54.738812 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:54:54.742432 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:54:54.743506 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:54:54.746652 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:54:54.747205 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:54:54.747205 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:54:54.748234 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.748234 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.748234 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:54:54.748234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.749879 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.750907 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:54:54.751890 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:54:54.753441 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:54:54.753947 [info ] [Thread-1 (]: 34 of 97 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:54:54.753947 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:54:54.753947 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:54:54.753947 [info ] [Thread-1 (]: 35 of 97 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:54:54.755499 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:54:54.755499 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:54:54.758520 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:54:54.758520 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:54:54.760881 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:54:54.762399 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:54:54.762399 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:54:54.762399 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.763575 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.763575 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:54:54.763575 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.764602 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.766151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:54:54.767372 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:54:54.767903 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:54:54.767903 [info ] [Thread-1 (]: 35 of 97 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:54:54.768908 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:54:54.769412 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:54:54.769412 [info ] [Thread-1 (]: 36 of 97 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:54:54.770417 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:54:54.770417 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:54:54.774148 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:54:54.775152 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:54:54.778112 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:54:54.780453 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:54:54.780453 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:54:54.781464 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.782127 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.782127 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:54:54.783138 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.785645 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:54.788268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:54:54.789880 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:54:54.791401 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:54:54.793420 [info ] [Thread-1 (]: 36 of 97 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:54:54.794438 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:54:54.794438 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:54:54.795962 [info ] [Thread-1 (]: 37 of 97 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:54:54.796518 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:54:54.797073 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:54:54.806617 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:54:54.809119 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:54:54.813660 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:54:54.814666 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:54:54.816098 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:54:54.816098 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.817683 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.818478 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:54:54.819099 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.826764 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:54:54.827938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:54:54.827938 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:54:54.829571 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:54:54.829571 [info ] [Thread-1 (]: 37 of 97 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:54:54.830581 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:54:54.831085 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:54:54.831085 [info ] [Thread-1 (]: 38 of 97 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:54:54.832088 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:54:54.832088 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:54:54.835179 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:54:54.835683 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:54:54.838189 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:54:54.838189 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:54:54.838189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:54:54.838189 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.839767 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.839767 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:54:54.840779 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.841291 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.842953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:54:54.843591 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:54:54.843591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:54:54.844619 [info ] [Thread-1 (]: 38 of 97 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.01s]
[0m06:54:54.844619 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:54:54.845604 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:54:54.845604 [info ] [Thread-1 (]: 39 of 97 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:54:54.846112 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:54:54.846685 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:54:54.855741 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:54:54.856751 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:54:54.860909 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:54:54.862516 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:54:54.862516 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:54:54.863108 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.863627 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.864632 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:54:54.864632 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.865773 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.866781 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:54:54.867304 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:54:54.868051 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:54:54.868051 [info ] [Thread-1 (]: 39 of 97 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:54:54.869054 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:54:54.869561 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:54:54.869561 [info ] [Thread-1 (]: 40 of 97 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:54:54.870561 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:54:54.870561 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:54:54.874128 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:54:54.875660 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:54:54.878430 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:54:54.879434 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:54:54.879434 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:54:54.879434 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.879434 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.879434 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:54:54.879434 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.882397 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:54.883878 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:54:54.883878 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:54:54.884895 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:54:54.885417 [info ] [Thread-1 (]: 40 of 97 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:54:54.885417 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:54:54.885417 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:54:54.886431 [info ] [Thread-1 (]: 41 of 97 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:54:54.886431 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:54:54.886431 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:54:54.891190 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:54:54.892268 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:54:54.894357 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:54:54.895334 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:54:54.896528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:54:54.897708 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.898224 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.898224 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:54:54.899797 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.902860 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:54:54.903865 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:54:54.905485 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:54:54.905485 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:54:54.905485 [info ] [Thread-1 (]: 41 of 97 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:54:54.906516 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:54:54.906516 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:54:54.907498 [info ] [Thread-1 (]: 42 of 97 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:54:54.907498 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:54:54.908496 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:54:54.911263 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:54:54.912453 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:54:54.914970 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:54:54.915490 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:54:54.915490 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:54:54.915490 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.915490 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.917248 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:54:54.917248 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.917870 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.919405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:54:54.919405 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:54:54.920410 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:54:54.920410 [info ] [Thread-1 (]: 42 of 97 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.01s]
[0m06:54:54.920410 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:54:54.921411 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:54:54.921411 [info ] [Thread-1 (]: 43 of 97 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:54:54.921411 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:54:54.922446 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:54:54.925486 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:54:54.925486 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:54:54.928966 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:54:54.929516 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:54:54.929516 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:54:54.929516 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.929516 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.929516 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:54:54.932224 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.932756 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.933768 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:54:54.933768 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:54:54.935273 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:54:54.935273 [info ] [Thread-1 (]: 43 of 97 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.01s]
[0m06:54:54.935955 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:54:54.936966 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:54:54.937471 [info ] [Thread-1 (]: 44 of 97 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:54:54.938104 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:54:54.938104 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:54:54.942902 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:54:54.943523 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:54:54.946091 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:54:54.947454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:54:54.948008 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:54:54.948008 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.949548 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.949548 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:54:54.950064 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.952600 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:54.952600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:54:54.954199 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:54:54.954199 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:54:54.954199 [info ] [Thread-1 (]: 44 of 97 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:54:54.955847 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:54:54.955847 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:54:54.956853 [info ] [Thread-1 (]: 45 of 97 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:54:54.956853 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:54:54.956853 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:54:54.961434 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:54:54.962567 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:54:54.964627 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:54:54.965681 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:54:54.966241 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:54:54.966241 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.966784 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.966784 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:54:54.967412 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.973180 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:54:54.975176 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:54:54.975176 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:54:54.976314 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:54:54.976817 [info ] [Thread-1 (]: 45 of 97 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:54:54.977368 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:54:54.977368 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:54:54.977953 [info ] [Thread-1 (]: 46 of 97 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:54:54.977953 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:54:54.977953 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:54:54.981548 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:54:54.982064 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:54:54.985578 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:54:54.986604 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:54:54.986604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:54:54.987610 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:54.988118 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:54.988118 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:54:54.988118 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:54.988118 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:54.989738 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:54:54.990749 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:54:54.990749 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:54:54.990749 [info ] [Thread-1 (]: 46 of 97 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m06:54:54.992609 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:54:54.992609 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:54:54.992609 [info ] [Thread-1 (]: 47 of 97 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:54:54.993614 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:54:54.993614 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:54:54.996823 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:54:54.997949 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:54:55.000169 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:54:55.001179 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:54:55.001179 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:54:55.002690 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.002690 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.002690 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:54:55.002690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.004415 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.005925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:54:55.006928 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:54:55.006928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:54:55.006928 [info ] [Thread-1 (]: 47 of 97 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m06:54:55.008443 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:54:55.008443 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:54:55.008443 [info ] [Thread-1 (]: 48 of 97 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:54:55.010591 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:54:55.010591 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:54:55.014804 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:54:55.015430 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:54:55.019138 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:54:55.019642 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:54:55.020649 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:54:55.020649 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.020649 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.020649 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:54:55.022154 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.025666 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:54:55.027902 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:54:55.027902 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:54:55.027902 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:54:55.029496 [info ] [Thread-1 (]: 48 of 97 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:54:55.029496 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:54:55.029496 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:54:55.030500 [info ] [Thread-1 (]: 49 of 97 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:54:55.031003 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:54:55.031003 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:54:55.035654 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:54:55.036661 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:54:55.038167 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:54:55.039786 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:54:55.040792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:54:55.040792 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.042590 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.042590 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:54:55.042590 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.051133 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:54:55.052638 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:54:55.054195 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:54:55.054195 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:54:55.054195 [info ] [Thread-1 (]: 49 of 97 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:54:55.055802 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:54:55.055802 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:54:55.055802 [info ] [Thread-1 (]: 50 of 97 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:54:55.056852 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:54:55.056852 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:54:55.060946 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:54:55.061958 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:54:55.063539 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:54:55.064547 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:54:55.064547 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:54:55.064547 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.066058 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.066560 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:54:55.066560 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.067131 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.068243 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:54:55.069250 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:54:55.069250 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:54:55.069757 [info ] [Thread-1 (]: 50 of 97 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m06:54:55.069757 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:54:55.070765 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:54:55.070765 [info ] [Thread-1 (]: 51 of 97 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:54:55.070765 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:54:55.072272 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:54:55.075339 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:54:55.075339 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:54:55.076887 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:54:55.078141 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:54:55.078141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:54:55.078141 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.079727 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.079727 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:54:55.080733 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.081238 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.082753 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:54:55.083760 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:54:55.083760 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:54:55.084774 [info ] [Thread-1 (]: 51 of 97 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m06:54:55.085294 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:54:55.085294 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:54:55.085853 [info ] [Thread-1 (]: 52 of 97 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:54:55.085853 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:54:55.086859 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:54:55.090538 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:54:55.091223 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:54:55.093458 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:54:55.094489 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:54:55.095463 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:54:55.096474 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.097093 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.097093 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:54:55.098101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.099610 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.100124 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:54:55.101132 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:54:55.101132 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:54:55.102637 [info ] [Thread-1 (]: 52 of 97 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:54:55.102637 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:54:55.102637 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:54:55.104238 [info ] [Thread-1 (]: 53 of 97 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:54:55.104238 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:54:55.105246 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:54:55.110464 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:54:55.111519 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:54:55.114002 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:54:55.114559 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:54:55.115562 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:54:55.116066 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.116593 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.117211 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:54:55.117211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.122909 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:54:55.123943 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:54:55.124941 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:54:55.125464 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:54:55.125464 [info ] [Thread-1 (]: 53 of 97 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:54:55.125464 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:54:55.125464 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:54:55.127091 [info ] [Thread-1 (]: 54 of 97 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:54:55.127780 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:54:55.128314 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:54:55.131925 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:54:55.132948 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:54:55.134947 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:54:55.136094 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:54:55.136094 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:54:55.136094 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.137645 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.137645 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:54:55.138230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.138230 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.140805 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:54:55.141312 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:54:55.141312 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:54:55.142834 [info ] [Thread-1 (]: 54 of 97 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m06:54:55.143406 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:54:55.143406 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:54:55.144413 [info ] [Thread-1 (]: 55 of 97 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:54:55.144413 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:54:55.145416 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:54:55.148504 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:54:55.149510 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:54:55.151156 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:54:55.152661 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:54:55.152661 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:54:55.152661 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.154252 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.154252 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:54:55.154252 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.155258 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.156933 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:54:55.156933 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:54:55.158531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:54:55.158531 [info ] [Thread-1 (]: 55 of 97 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:54:55.158531 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:54:55.158531 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:54:55.160125 [info ] [Thread-1 (]: 56 of 97 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:54:55.160125 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:54:55.160720 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:54:55.164542 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:54:55.165545 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:54:55.167746 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:54:55.168902 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:54:55.169909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:54:55.169909 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.170907 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.170907 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:54:55.170907 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.173102 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:55.174114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:54:55.175114 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:54:55.175619 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:54:55.175619 [info ] [Thread-1 (]: 56 of 97 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:54:55.175619 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:54:55.175619 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:54:55.177124 [info ] [Thread-1 (]: 57 of 97 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:54:55.177715 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:54:55.177715 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:54:55.181905 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:54:55.182935 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:54:55.186596 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:54:55.188102 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:54:55.188102 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:54:55.188102 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.189664 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.190677 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:54:55.192702 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.198017 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:54:55.201192 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:54:55.201192 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:54:55.202715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:54:55.202715 [info ] [Thread-1 (]: 57 of 97 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:54:55.204318 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:54:55.204318 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:54:55.204318 [info ] [Thread-1 (]: 58 of 97 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:54:55.204318 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:54:55.206064 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:54:55.210148 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:54:55.211496 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:54:55.213052 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:54:55.213574 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:54:55.213574 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:54:55.213574 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.214603 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.214603 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:54:55.214603 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.215920 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.218204 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:54:55.219225 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:54:55.219760 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:54:55.219760 [info ] [Thread-1 (]: 58 of 97 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.02s]
[0m06:54:55.220753 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:54:55.220753 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:54:55.220753 [info ] [Thread-1 (]: 59 of 97 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:54:55.220753 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:54:55.220753 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:54:55.224261 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:54:55.225764 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:54:55.227405 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:54:55.227970 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:54:55.227970 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:54:55.227970 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.229747 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.230287 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:54:55.230287 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.230838 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.230838 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:54:55.232543 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:54:55.232543 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:54:55.233577 [info ] [Thread-1 (]: 59 of 97 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:54:55.233577 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:54:55.233577 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:54:55.233577 [info ] [Thread-1 (]: 60 of 97 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:54:55.235085 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:54:55.235659 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:54:55.241445 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:54:55.242643 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:54:55.243674 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:54:55.245290 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:54:55.245840 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:54:55.245840 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.245840 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.246853 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:54:55.246853 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.250109 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:54:55.251114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:54:55.252656 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:54:55.252656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:54:55.252656 [info ] [Thread-1 (]: 60 of 97 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:54:55.254320 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:54:55.254320 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:54:55.254320 [info ] [Thread-1 (]: 61 of 97 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:54:55.255534 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:54:55.255534 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:54:55.258552 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:54:55.260291 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:54:55.262560 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:54:55.264654 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:54:55.264654 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:54:55.265663 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.266676 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.267307 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:54:55.267307 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:55.272943 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:54:55.274947 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:54:55.275967 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:54:55.275967 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:54:55.277478 [info ] [Thread-1 (]: 61 of 97 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:54:55.278080 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:54:55.278080 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:54:55.278080 [info ] [Thread-1 (]: 62 of 97 START sql table model main.dim_atividade .............................. [RUN]
[0m06:54:55.279617 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:54:55.279617 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:54:55.282133 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:54:55.283232 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:54:55.288404 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:54:55.289962 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:54:55.289962 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:54:55.290526 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.291094 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.291094 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:54:55.291094 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:54:55.292609 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.296927 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:54:55.296927 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:54:55.297930 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.298575 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:54:55.299580 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:54:55.299580 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:54:55.301086 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.303099 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:54:55.303099 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:54:55.303099 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.304103 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:54:55.305663 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897C13AD0>]}
[0m06:54:55.305663 [info ] [Thread-1 (]: 62 of 97 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.02s]
[0m06:54:55.306668 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:54:55.306668 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:54:55.307669 [info ] [Thread-1 (]: 63 of 97 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:54:55.308668 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:54:55.308668 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:54:55.311746 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:54:55.312856 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:54:55.315516 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:54:55.317020 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:54:55.317020 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:54:55.317020 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.317548 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.318091 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:54:55.318091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:54:55.319603 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.322121 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:54:55.322121 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:54:55.323640 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.323640 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:54:55.325158 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:54:55.325158 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:54:55.325158 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.328185 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:54:55.329754 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:54:55.331276 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.332286 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:54:55.334209 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F7619760>]}
[0m06:54:55.334209 [info ] [Thread-1 (]: 63 of 97 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m06:54:55.335222 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:54:55.335222 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:54:55.335727 [info ] [Thread-1 (]: 64 of 97 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:54:55.335727 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:54:55.336733 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:54:55.338239 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:54:55.338239 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:54:55.343900 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:54:55.346539 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:54:55.346539 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:54:55.347154 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:55.347154 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.348184 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:54:55.348184 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:54:55.348715 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.351429 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:54:55.351429 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:54:55.352931 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.352931 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:54:55.353934 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:54:55.353934 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:54:55.354439 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:55.357005 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:54:55.357005 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:54:55.357005 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:55.358511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:54:55.358511 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897CE62D0>]}
[0m06:54:56.327334 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:54:56.333135 [info ] [Thread-1 (]: 64 of 97 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.02s]
[0m06:54:56.335143 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:54:56.336597 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:54:56.337607 [info ] [Thread-1 (]: 65 of 97 START sql table model main.dim_controle ............................... [RUN]
[0m06:54:56.338113 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:54:56.338113 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:54:56.344238 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:54:56.344238 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:54:56.348377 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:54:56.349884 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:54:56.350388 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:54:56.350388 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.351393 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.351393 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:54:56.351393 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:54:56.352925 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.356675 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:54:56.356675 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:54:56.356675 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.358183 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:54:56.359704 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:54:56.360212 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:54:56.360809 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.363863 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:54:56.363863 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:54:56.364874 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.365409 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:54:56.365409 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F74AE4E0>]}
[0m06:54:56.366958 [info ] [Thread-1 (]: 65 of 97 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m06:54:56.367574 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:54:56.368232 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:54:56.368745 [info ] [Thread-1 (]: 66 of 97 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:54:56.369253 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:54:56.369253 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:54:56.371273 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:54:56.372273 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:54:56.374354 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:54:56.375861 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:54:56.375861 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:54:56.376868 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.377436 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.377436 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:54:56.378042 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:54:56.378042 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.382108 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:54:56.382108 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:54:56.383188 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.384169 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:54:56.384169 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:54:56.384169 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:54:56.385823 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.387827 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:54:56.388405 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:54:56.388405 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.390023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:54:56.390023 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897CFA9C0>]}
[0m06:54:56.390023 [info ] [Thread-1 (]: 66 of 97 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.02s]
[0m06:54:56.392124 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:54:56.392124 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:54:56.392664 [info ] [Thread-1 (]: 67 of 97 START sql table model main.dim_porte .................................. [RUN]
[0m06:54:56.393211 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:54:56.393211 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:54:56.395755 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:54:56.396346 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:54:56.399959 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:54:56.401491 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:54:56.403007 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:54:56.403007 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.403007 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.404015 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:54:56.404015 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:54:56.404015 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.407598 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:54:56.407598 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:54:56.408598 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.409105 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:54:56.410109 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:54:56.410109 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:54:56.411282 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.413583 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:54:56.413583 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:54:56.414587 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.415107 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:54:56.416026 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F70D7CB0>]}
[0m06:54:56.416627 [info ] [Thread-1 (]: 67 of 97 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.02s]
[0m06:54:56.417283 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:54:56.417283 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:54:56.417825 [info ] [Thread-1 (]: 68 of 97 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:54:56.418357 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:54:56.418357 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:54:56.419959 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:54:56.420959 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:54:56.423486 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:54:56.424990 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:54:56.425621 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:54:56.426192 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.427208 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.427208 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:54:56.427729 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:54:56.428307 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.430820 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:54:56.430820 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:54:56.432452 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.433460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:54:56.433460 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:54:56.433460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:54:56.435553 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.439073 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:54:56.439576 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:54:56.440583 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.442101 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:54:56.442606 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897D1D1F0>]}
[0m06:54:56.443165 [info ] [Thread-1 (]: 68 of 97 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m06:54:56.443546 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:54:56.443546 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:54:56.444574 [info ] [Thread-1 (]: 69 of 97 START sql table model main.dim_regiao ................................. [RUN]
[0m06:54:56.444574 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:54:56.444574 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:54:56.447870 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:54:56.448415 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:54:56.451927 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:54:56.452943 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:54:56.452943 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:54:56.452943 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.454028 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.454562 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:54:56.454562 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:54:56.455568 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.457079 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:54:56.458590 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:54:56.458590 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.460189 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:54:56.460732 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:54:56.460732 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:54:56.461610 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.463780 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:54:56.463780 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:54:56.464977 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.465538 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:54:56.466545 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897D1C890>]}
[0m06:54:56.467051 [info ] [Thread-1 (]: 69 of 97 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m06:54:56.467051 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:54:56.467723 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:54:56.468377 [info ] [Thread-1 (]: 70 of 97 START sql table model main.dim_risco .................................. [RUN]
[0m06:54:56.468962 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:54:56.468962 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:54:56.470968 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:54:56.471967 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:54:56.474167 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:54:56.475168 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:54:56.475168 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:54:56.475168 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.475168 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.476677 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:54:56.477180 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:54:56.477180 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.480498 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:54:56.481057 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:54:56.481057 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.482570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:54:56.482570 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:54:56.482570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:54:56.483576 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.486744 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:54:56.486744 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:54:56.487746 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.489776 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:54:56.490805 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897D389E0>]}
[0m06:54:56.490805 [info ] [Thread-1 (]: 70 of 97 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m06:54:56.492452 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:54:56.493461 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:54:56.493461 [info ] [Thread-1 (]: 71 of 97 START sql table model main.dim_segmento ............................... [RUN]
[0m06:54:56.495339 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:54:56.495339 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:54:56.499879 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:54:56.501886 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:54:56.505561 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:54:56.506568 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:54:56.506568 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:54:56.507567 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.507567 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.507567 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:54:56.508565 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:54:56.509072 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.513695 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:54:56.513695 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:54:56.515211 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.516576 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:54:56.516576 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:54:56.517083 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:54:56.518252 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.520269 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:54:56.520269 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:54:56.520269 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.521276 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:54:56.522274 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897D47E00>]}
[0m06:54:56.522778 [info ] [Thread-1 (]: 71 of 97 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m06:54:56.523784 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:54:56.523784 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:54:56.523784 [info ] [Thread-1 (]: 72 of 97 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:54:56.523784 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:54:56.525292 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:54:56.527979 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:54:56.529592 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:54:56.531134 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:54:56.532649 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:54:56.533660 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:54:56.535168 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.535891 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.535891 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:54:56.536898 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:54:56.538410 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.539991 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:54:56.541000 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:54:56.541000 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:54:56.542146 [info ] [Thread-1 (]: 72 of 97 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.02s]
[0m06:54:56.542663 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:54:56.543242 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:54:56.543242 [info ] [Thread-1 (]: 73 of 97 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:54:56.544248 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:54:56.544248 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:54:56.548076 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:54:56.550233 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:54:56.551743 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:54:56.552750 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:54:56.553758 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:54:56.553758 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.554264 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.554264 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:54:56.554264 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:56.556276 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.557292 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:54:56.558832 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:54:56.558832 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:54:56.558832 [info ] [Thread-1 (]: 73 of 97 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:54:56.559855 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:54:56.559855 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:54:56.560871 [info ] [Thread-1 (]: 74 of 97 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:54:56.560871 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:54:56.560871 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:54:56.565935 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:54:56.566947 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:54:56.570283 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:54:56.571266 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:54:56.571266 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:54:56.572286 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.572286 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.572286 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:54:56.572286 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:54:56.574370 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:54:56.575384 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:54:56.576963 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:54:56.576963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:54:56.578010 [info ] [Thread-1 (]: 74 of 97 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m06:54:56.578010 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:54:56.578010 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:54:56.578010 [info ] [Thread-1 (]: 75 of 97 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:54:56.579654 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:54:56.579654 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:54:56.582368 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:54:56.583398 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:54:56.585432 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:54:56.586436 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:54:56.586436 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:54:56.586436 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.587436 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.587436 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:54:56.587957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:54:56.588516 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.589534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:54:56.590544 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:54:56.590544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:54:56.591167 [info ] [Thread-1 (]: 75 of 97 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:54:56.592173 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:54:56.592677 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:54:56.592677 [info ] [Thread-1 (]: 76 of 97 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:54:56.593211 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:54:56.593211 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:54:56.598328 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:54:56.599840 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:54:56.601353 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:54:56.602859 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:54:56.602859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:54:56.602859 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.603866 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.603866 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:54:56.604372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:56.605377 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.606385 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:54:56.607385 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:54:56.607385 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:54:56.608385 [info ] [Thread-1 (]: 76 of 97 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.02s]
[0m06:54:56.608893 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:54:56.608893 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:54:56.608893 [info ] [Thread-1 (]: 77 of 97 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:54:56.609899 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:54:56.609899 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:54:56.613541 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:54:56.614617 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:54:56.615726 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:54:56.617263 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:54:56.617263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:54:56.617813 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.618349 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.618349 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:54:56.618893 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:54:56.619906 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.620925 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:54:56.621922 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:54:56.621922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:54:56.621922 [info ] [Thread-1 (]: 77 of 97 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:54:56.623074 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:54:56.623074 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:54:56.624077 [info ] [Thread-1 (]: 78 of 97 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:54:56.624077 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:54:56.625078 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:54:56.628122 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:54:56.628122 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:54:56.630773 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:54:56.631368 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:54:56.631919 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:54:56.631919 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.631919 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.632924 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:54:56.632924 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:54:56.632924 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.634428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:54:56.634954 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:54:56.635600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:54:56.635600 [info ] [Thread-1 (]: 78 of 97 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:54:56.636611 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:54:56.636611 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:54:56.636611 [info ] [Thread-1 (]: 79 of 97 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:54:56.637613 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:54:56.637613 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:54:56.641935 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:54:56.643445 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:54:56.646959 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:54:56.647963 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:54:56.647963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:54:56.647963 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.649498 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:54:56.649498 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:54:56.649498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:54:56.652010 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.653010 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:54:56.653514 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:54:56.654017 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:54:56.654017 [info ] [Thread-1 (]: 79 of 97 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m06:54:56.654017 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:54:56.655594 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:54:56.655594 [info ] [Thread-1 (]: 80 of 97 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:54:56.656599 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:54:56.656599 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:54:56.661119 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:54:56.661623 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:54:56.666655 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:54:56.668323 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:54:56.668323 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:54:56.669330 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.669834 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.669834 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:54:56.669834 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:54:56.671338 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.673437 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:54:56.673437 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:54:56.674949 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:54:56.675629 [info ] [Thread-1 (]: 80 of 97 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.02s]
[0m06:54:56.675629 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:54:56.675629 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:54:56.675629 [info ] [Thread-1 (]: 81 of 97 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:54:56.677226 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:54:56.677891 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:54:56.680449 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:54:56.680993 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:54:56.683531 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:54:56.685663 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:54:56.685663 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:54:56.685663 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:54:56.686699 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:54:56.686699 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:54:56.687669 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:55:04.938097 [debug] [Thread-1 (]: SQL status: OK in 8.250 seconds
[0m06:55:04.941853 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:55:04.941853 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:55:04.943540 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:04.944545 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:55:04.945560 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:55:04.946084 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:55:05.098062 [debug] [Thread-1 (]: SQL status: OK in 0.152 seconds
[0m06:55:05.101201 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:55:05.101201 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:55:05.101201 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:05.102708 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:55:05.102708 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F764AA50>]}
[0m06:55:05.103715 [info ] [Thread-1 (]: 81 of 97 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 8.43s]
[0m06:55:05.103715 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:55:05.103715 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:55:05.103715 [info ] [Thread-1 (]: 82 of 97 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:55:05.105188 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:55:05.105188 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:55:05.108965 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:55:05.109997 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:55:05.113640 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:55:05.115411 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:55:05.115411 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:55:05.115411 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:05.117200 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:05.117200 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:55:05.117790 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:55:05.285634 [debug] [Thread-1 (]: SQL status: OK in 0.168 seconds
[0m06:55:05.288143 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:55:05.288143 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:55:05.290001 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:05.290954 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:55:05.290954 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:55:05.290954 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:55:05.297322 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:55:05.298489 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:55:05.299494 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:55:05.300000 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:05.301007 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:55:05.301007 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897D96B10>]}
[0m06:55:05.301007 [info ] [Thread-1 (]: 82 of 97 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.20s]
[0m06:55:05.302513 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:55:05.302513 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:55:05.303065 [info ] [Thread-1 (]: 83 of 97 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:55:05.303065 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:55:05.303065 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:55:05.307185 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:55:05.308187 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:55:05.310375 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:55:05.311110 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:55:05.311785 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:55:05.311785 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:05.312383 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:05.312383 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:55:05.312383 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:55:16.752164 [debug] [Thread-1 (]: SQL status: OK in 11.439 seconds
[0m06:55:16.754186 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:55:16.754186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:55:16.754893 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:16.755895 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:55:16.756508 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:55:16.756508 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:55:16.787517 [debug] [Thread-1 (]: SQL status: OK in 0.031 seconds
[0m06:55:16.788125 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:55:16.788125 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:55:16.789894 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:16.790917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:55:16.790917 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F7655E20>]}
[0m06:55:16.792006 [info ] [Thread-1 (]: 83 of 97 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 11.49s]
[0m06:55:16.792511 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:55:16.792511 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:55:16.793516 [info ] [Thread-1 (]: 84 of 97 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:55:16.793516 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:55:16.793516 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:55:16.797174 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:55:16.797769 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:55:16.799951 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:55:16.800957 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:55:16.800957 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:55:16.801998 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:16.802503 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:16.802503 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:55:16.802503 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:55:17.013886 [debug] [Thread-1 (]: SQL status: OK in 0.211 seconds
[0m06:55:17.015398 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:55:17.015398 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:55:17.016975 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:17.019240 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:55:17.019240 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:55:17.019744 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:55:17.027351 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:55:17.027941 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:55:17.029582 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:55:17.029582 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:17.030791 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:55:17.030791 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A897DAD040>]}
[0m06:55:17.031432 [info ] [Thread-1 (]: 84 of 97 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.24s]
[0m06:55:17.032165 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:55:17.032165 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:55:17.032925 [info ] [Thread-1 (]: 85 of 97 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:55:17.033483 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:55:17.034050 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:55:17.036655 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:55:17.036655 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:55:17.039849 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:55:17.040859 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:55:17.040859 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:55:17.040859 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.041964 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.042469 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:55:17.042469 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:55:17.333799 [debug] [Thread-1 (]: SQL status: OK in 0.291 seconds
[0m06:55:17.335982 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:55:17.335982 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:55:17.335982 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:17.336987 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:55:17.337987 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:55:17.337987 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:55:17.375597 [debug] [Thread-1 (]: SQL status: OK in 0.038 seconds
[0m06:55:17.377741 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:55:17.378438 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:55:17.378438 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:17.379948 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:55:17.379948 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c618d88b-53fd-4ad0-a4f7-646c9a45edf0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F761D250>]}
[0m06:55:17.379948 [info ] [Thread-1 (]: 85 of 97 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.35s]
[0m06:55:17.380954 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:55:17.380954 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:55:17.380954 [info ] [Thread-1 (]: 86 of 97 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:55:17.382381 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:55:17.382381 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:55:17.386085 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:55:17.387091 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:55:17.388597 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:55:17.388597 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:55:17.390102 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:55:17.390102 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.390642 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:17.390642 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:55:17.391302 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.391302 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:17.392813 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:55:17.393819 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:55:17.393819 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:55:17.394435 [info ] [Thread-1 (]: 86 of 97 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:55:17.395441 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:55:17.395441 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:55:17.396792 [info ] [Thread-1 (]: 87 of 97 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:55:17.397612 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:55:17.397612 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:55:17.402231 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:55:17.403230 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:55:17.404240 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:55:17.405886 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:55:17.406188 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:55:17.406188 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.406893 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.406893 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:55:17.407896 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.408893 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.410726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:55:17.410726 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:55:17.411845 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:55:17.412184 [info ] [Thread-1 (]: 87 of 97 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.01s]
[0m06:55:17.412688 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:55:17.412688 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:55:17.413694 [info ] [Thread-1 (]: 88 of 97 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:55:17.413694 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:55:17.413694 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:55:17.418305 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:55:17.418962 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:55:17.420973 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:55:17.422475 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:55:17.422475 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:55:17.422475 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.423482 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:17.423482 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:55:17.423482 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:55:17.425405 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.426411 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:55:17.426916 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:55:17.426916 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:55:17.428060 [info ] [Thread-1 (]: 88 of 97 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m06:55:17.428565 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:55:17.428565 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:55:17.428565 [info ] [Thread-1 (]: 89 of 97 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:55:17.429570 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:55:17.430125 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:55:17.433478 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:55:17.433478 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:55:17.435751 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:55:17.436856 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:55:17.436856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:55:17.437757 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.438262 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:55:17.438262 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:55:17.438262 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.439267 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.440277 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:55:17.440782 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:55:17.440782 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:55:17.440782 [info ] [Thread-1 (]: 89 of 97 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.01s]
[0m06:55:17.442421 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:55:17.442421 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:55:17.442421 [info ] [Thread-1 (]: 90 of 97 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:55:17.443425 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:55:17.443929 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:55:17.447900 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:55:17.448483 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:55:17.449996 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:55:17.452000 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:55:17.453001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:55:17.453001 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.454402 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.454402 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:55:17.455502 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.457020 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.459537 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:55:17.460539 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:55:17.461353 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:55:17.462389 [info ] [Thread-1 (]: 90 of 97 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:55:17.463444 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:55:17.464193 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:55:17.464193 [info ] [Thread-1 (]: 91 of 97 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:55:17.465417 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:55:17.465417 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:55:17.472461 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:55:17.481876 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:55:17.485888 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:55:17.488566 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:55:17.489576 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:55:17.490881 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.490881 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.492414 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:55:17.493939 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.495455 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.499503 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:55:17.500786 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:55:17.501795 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:55:17.502805 [info ] [Thread-1 (]: 91 of 97 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.04s]
[0m06:55:17.504324 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:55:17.505332 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:55:17.506341 [info ] [Thread-1 (]: 92 of 97 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:55:17.507344 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:55:17.508852 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:55:17.516140 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:55:17.519103 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:55:17.525139 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:55:17.528186 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:55:17.528512 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:55:17.528512 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.530967 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.531477 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:55:17.532237 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.534261 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.536372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:55:17.537880 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:55:17.538532 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:55:17.539546 [info ] [Thread-1 (]: 92 of 97 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.03s]
[0m06:55:17.540054 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:55:17.541064 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:55:17.542694 [info ] [Thread-1 (]: 93 of 97 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:55:17.543791 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:55:17.543791 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:55:17.549991 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:55:17.550995 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:55:17.554008 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:55:17.556560 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:55:17.557560 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:55:17.557560 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.559078 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.559078 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:55:17.560087 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.561834 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.564558 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:55:17.567258 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:55:17.567908 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:55:17.569426 [info ] [Thread-1 (]: 93 of 97 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.03s]
[0m06:55:17.571438 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:55:17.573459 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:55:17.574458 [info ] [Thread-1 (]: 94 of 97 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:55:17.575458 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:55:17.577245 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:55:17.586593 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:55:17.588098 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:55:17.593493 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:55:17.596010 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:55:17.597020 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:55:17.597527 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.598034 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.599650 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:55:17.600321 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.602843 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.604587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:55:17.605593 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:55:17.606122 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:55:17.606122 [info ] [Thread-1 (]: 94 of 97 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.03s]
[0m06:55:17.607145 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:55:17.607145 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:55:17.607145 [info ] [Thread-1 (]: 95 of 97 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:55:17.607145 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:55:17.608685 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:55:17.612677 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:55:17.613767 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:55:17.617089 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:55:17.618334 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:55:17.618334 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:55:17.618890 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.618890 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.619902 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:55:17.620902 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.625438 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:55:17.627589 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:55:17.628099 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:55:17.628099 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:55:17.629692 [info ] [Thread-1 (]: 95 of 97 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m06:55:17.631214 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:55:17.631214 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:55:17.632243 [info ] [Thread-1 (]: 96 of 97 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:55:17.632780 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:55:17.632780 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:55:17.636971 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:55:17.638499 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:55:17.640830 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:55:17.644002 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:55:17.644002 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:55:17.645506 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.646629 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.646629 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:55:17.647633 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.648647 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.650428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:55:17.651454 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:55:17.652964 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:55:17.653967 [info ] [Thread-1 (]: 96 of 97 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.02s]
[0m06:55:17.653967 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:55:17.653967 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:55:17.655569 [info ] [Thread-1 (]: 97 of 97 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:55:17.656583 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:55:17.656583 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:55:17.663776 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:55:17.664791 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:55:17.667741 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:55:17.669429 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:55:17.669790 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:55:17.670552 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:55:17.671506 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.671506 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:55:17.671506 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:55:17.672542 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:55:17.675423 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:55:17.676813 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:55:17.677396 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:55:17.678542 [info ] [Thread-1 (]: 97 of 97 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.02s]
[0m06:55:17.678849 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:55:17.681395 [debug] [MainThread]: Using duckdb connection "master"
[0m06:55:17.681897 [debug] [MainThread]: On master: BEGIN
[0m06:55:17.681897 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:55:17.682899 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:55:17.682899 [debug] [MainThread]: On master: COMMIT
[0m06:55:17.683899 [debug] [MainThread]: Using duckdb connection "master"
[0m06:55:17.683899 [debug] [MainThread]: On master: COMMIT
[0m06:55:17.683899 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:55:17.683899 [debug] [MainThread]: On master: Close
[0m06:55:17.685401 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:55:17.685401 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:55:17.686405 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:55:17.686405 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393' was properly closed.
[0m06:55:17.686405 [info ] [MainThread]: 
[0m06:55:17.687911 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests in 0 hours 0 minutes and 27.11 seconds (27.11s).
[0m06:55:17.709841 [debug] [MainThread]: Command end result
[0m06:55:17.831090 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:55:17.834842 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:55:17.846782 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:55:17.846782 [info ] [MainThread]: 
[0m06:55:17.847309 [info ] [MainThread]: [32mCompleted successfully[0m
[0m06:55:17.847999 [info ] [MainThread]: 
[0m06:55:17.847999 [info ] [MainThread]: Done. PASS=97 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=97
[0m06:55:17.849551 [debug] [MainThread]: Command `dbt build` succeeded at 06:55:17.847999 after 28.23 seconds
[0m06:55:17.849551 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F49A3BF0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F7117AD0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001A8F25347D0>]}
[0m06:55:17.850098 [debug] [MainThread]: Flushing usage events
[0m06:55:18.613943 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:24:57.741191 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018EAA587590>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018EA831D730>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018EAA539C10>]}


============================== 06:24:57.746880 | c9ff98e6-7ea2-4c88-aa69-bb00c1b974f5 ==============================
[0m06:24:57.746880 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:24:57.748513 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'src/bacen_ifdata/data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'indirect_selection': 'eager', 'use_colors': 'True', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios --project-dir src/bacen_ifdata/data_analytics --profiles-dir src/bacen_ifdata/data_analytics', 'use_experimental_parser': 'False', 'log_path': 'src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:24:57.754652 [error] [MainThread]: Encountered an error:
Parsing Error
  Env var required but not provided: 'GOLD_DB_PATH'
[0m06:24:57.756168 [debug] [MainThread]: Command `dbt build` failed at 06:24:57.756168 after 0.40 seconds
[0m06:24:57.756168 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018EAA56A3F0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018EAA37D940>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000018EAADB6990>]}
[0m06:24:57.757175 [debug] [MainThread]: Flushing usage events
[0m06:24:58.549693 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:25:17.727081 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD1BA71D0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD1BA61B0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD1BA7350>]}


============================== 06:25:17.734733 | 20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac ==============================
[0m06:25:17.734733 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:25:17.734733 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'fail_fast': 'False', 'debug': 'False', 'log_format': 'default', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'src/bacen_ifdata/data_analytics', 'use_colors': 'True', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios --project-dir src/bacen_ifdata/data_analytics --profiles-dir src/bacen_ifdata/data_analytics', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:25:17.972302 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD3661C10>]}
[0m06:25:18.016777 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017ACF2BDBB0>]}
[0m06:25:18.031214 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:25:19.574859 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:25:19.733507 [info ] [MainThread]: Unable to do partial parsing because profile has changed
[0m06:25:19.734512 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD1BA69C0>]}
[0m06:25:24.059982 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on 'dim_instituicao'
in package 'bacen_ifdata_analytics' (models\gold\schema.yml). Arguments to
generic tests should be nested under the `arguments` property.
[0m06:25:24.060537 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD3A28CB0>]}
[0m06:25:24.396928 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:25:24.405816 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD3D50650>]}
[0m06:25:24.483324 [debug] [MainThread]: Wrote artifact WritableManifest to src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:25:24.496914 [debug] [MainThread]: Wrote artifact SemanticManifest to src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:25:24.559692 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD3D8B140>]}
[0m06:25:24.560746 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:25:24.564348 [info ] [MainThread]: 
[0m06:25:24.564348 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:25:24.565358 [info ] [MainThread]: 
[0m06:25:24.565358 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:25:24.569041 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:25:28.163072 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:25:28.163072 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:25:28.163072 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:25:28.777525 [debug] [ThreadPool]: SQL status: OK in 0.613 seconds
[0m06:25:28.779031 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:25:28.779031 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:25:28.780038 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:25:28.785492 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:25:28.787557 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:25:28.788202 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:25:28.789209 [debug] [ThreadPool]: SQL status: OK in 0.002 seconds
[0m06:25:28.790714 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:25:28.790714 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:25:28.790714 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:25:28.790714 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:25:28.790714 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:25:28.792252 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:25:28.793260 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:25:28.793765 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:25:28.793765 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:25:28.793765 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:25:28.793765 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:25:28.796475 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:25:28.799386 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:25:28.800999 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:25:28.800999 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:25:28.801601 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:25:28.801601 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:25:28.801601 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:25:28.817634 [debug] [ThreadPool]: SQL status: OK in 0.015 seconds
[0m06:25:28.818652 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:25:28.830461 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:25:28.831148 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:25:28.834352 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD3D8EAB0>]}
[0m06:25:28.834880 [debug] [MainThread]: Using duckdb connection "master"
[0m06:25:28.834880 [debug] [MainThread]: On master: BEGIN
[0m06:25:28.834880 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:25:28.835416 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:25:28.835416 [debug] [MainThread]: On master: COMMIT
[0m06:25:28.835416 [debug] [MainThread]: Using duckdb connection "master"
[0m06:25:28.835416 [debug] [MainThread]: On master: COMMIT
[0m06:25:28.836438 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:25:28.836438 [debug] [MainThread]: On master: Close
[0m06:25:28.840759 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:25:28.840759 [info ] [Thread-1 (]: 1 of 32 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:25:28.842302 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:25:28.842302 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:25:28.853911 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:28.856464 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:25:28.879821 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:28.882022 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:28.882527 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:25:28.882527 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:25:28.883046 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:28.883639 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:28.884174 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN '1 - Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN '2 - Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN '3 - Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN '4 - Instituições com Operações de Câmbio'
            ELSE 'Outros'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:25:29.357756 [debug] [Thread-1 (]: SQL status: OK in 0.473 seconds
[0m06:25:29.362098 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:29.362098 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:25:29.363097 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.363630 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:29.363630 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:25:29.364654 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:29.369910 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:29.369910 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:25:29.370911 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:29.371966 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:29.373556 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:25:29.373556 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.384122 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:25:29.384679 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:29.384679 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:25:29.396144 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:25:29.400489 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:25:29.400489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:25:29.401707 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:29.402742 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:25:29.405404 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD14E02F0>]}
[0m06:25:29.405404 [info ] [Thread-1 (]: 1 of 32 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.56s]
[0m06:25:29.406428 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:25:29.406428 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:25:29.407638 [info ] [Thread-1 (]: 2 of 32 START sql table model main.dim_tempo ................................... [RUN]
[0m06:25:29.407638 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:25:29.408655 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:25:29.415245 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.416436 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:25:29.419063 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.420070 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.421081 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:25:29.421081 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:29.422091 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:29.422599 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.422599 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:25:29.479080 [debug] [Thread-1 (]: SQL status: OK in 0.056 seconds
[0m06:25:29.480597 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.480597 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:25:29.481626 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.482229 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.482229 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:25:29.483236 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.485494 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.485494 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:25:29.486504 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.488533 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.488533 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:25:29.489179 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.490189 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:25:29.490189 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.490189 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:25:29.491696 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:29.493712 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:25:29.493712 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:25:29.494718 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:29.494718 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:25:29.496292 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD434AA50>]}
[0m06:25:29.496904 [info ] [Thread-1 (]: 2 of 32 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.09s]
[0m06:25:29.496904 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:25:29.496904 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:25:29.496904 [info ] [Thread-1 (]: 3 of 32 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m06:25:29.498508 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:25:29.498508 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:25:29.501740 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.502767 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:25:29.505335 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.506364 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.507348 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:25:29.507348 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:29.507348 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.507348 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.507348 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:25:29.785383 [debug] [Thread-1 (]: SQL status: OK in 0.277 seconds
[0m06:25:29.786388 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.786388 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:25:29.787386 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.788446 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.788446 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:25:29.789491 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.792510 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.792510 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m06:25:29.793517 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:29.796105 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.796685 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:25:29.797299 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:29.798329 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:25:29.798952 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:29.798952 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:25:30.013000 [debug] [Thread-1 (]: SQL status: OK in 0.213 seconds
[0m06:25:30.017592 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:25:30.017592 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:25:30.020711 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:25:30.022285 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:25:30.023293 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD43C2360>]}
[0m06:25:30.023293 [info ] [Thread-1 (]: 3 of 32 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.52s]
[0m06:25:30.024433 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:25:30.025024 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:25:30.026033 [info ] [Thread-1 (]: 4 of 32 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:25:30.026033 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:25:30.027396 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:25:30.035375 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:25:30.036382 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:25:30.054325 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:25:30.055331 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:25:30.055331 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:25:30.056850 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.057856 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.057856 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:25:30.058859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.060452 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.064557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:25:30.066075 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:25:30.067084 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:25:30.067592 [info ] [Thread-1 (]: 4 of 32 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.04s]
[0m06:25:30.068100 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:25:30.068100 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:25:30.069109 [info ] [Thread-1 (]: 5 of 32 START test not_null_dim_instituicao_id_localizacao ..................... [RUN]
[0m06:25:30.069109 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:25:30.069109 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:25:30.076073 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:25:30.077581 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:25:30.079670 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:25:30.081809 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:25:30.081809 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:25:30.081809 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.083969 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.083969 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:25:30.084600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.085608 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.087468 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:25:30.088598 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:25:30.088598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:25:30.089608 [info ] [Thread-1 (]: 5 of 32 PASS not_null_dim_instituicao_id_localizacao ........................... [[32mPASS[0m in 0.02s]
[0m06:25:30.089608 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:25:30.091118 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:25:30.091118 [info ] [Thread-1 (]: 6 of 32 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:25:30.092129 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:25:30.093203 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:25:30.096975 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:25:30.099170 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:25:30.102867 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:25:30.104378 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:25:30.105386 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:25:30.105386 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.106392 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.106392 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:25:30.106392 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.109911 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:25:30.111022 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:25:30.112031 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:25:30.113031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:25:30.114175 [info ] [Thread-1 (]: 6 of 32 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:25:30.115185 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:25:30.116358 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:25:30.116932 [info ] [Thread-1 (]: 7 of 32 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:25:30.117939 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:25:30.117939 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:25:30.124872 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:25:30.127521 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:25:30.131085 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:25:30.133829 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:25:30.133829 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:25:30.135368 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.136376 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.136376 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:25:30.138627 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.141160 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:25:30.143407 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:25:30.145531 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:25:30.146059 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:25:30.147245 [info ] [Thread-1 (]: 7 of 32 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.03s]
[0m06:25:30.147245 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:25:30.148899 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:25:30.149454 [info ] [Thread-1 (]: 8 of 32 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:25:30.149454 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:25:30.151047 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:25:30.156745 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:25:30.157742 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:25:30.160459 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:25:30.161465 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:25:30.163023 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:25:30.163023 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.163023 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.164601 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:25:30.165608 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.170151 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:25:30.170656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:25:30.173294 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:25:30.173294 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:25:30.173294 [info ] [Thread-1 (]: 8 of 32 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m06:25:30.176111 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:25:30.177109 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:25:30.178432 [info ] [Thread-1 (]: 9 of 32 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:25:30.179433 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:25:30.179433 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:25:30.185366 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:25:30.188119 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:25:30.190770 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:25:30.193472 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:25:30.195092 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:25:30.196106 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.197271 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.197271 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:25:30.197271 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.201618 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:25:30.204651 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:25:30.206670 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:25:30.207672 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:25:30.207672 [info ] [Thread-1 (]: 9 of 32 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.03s]
[0m06:25:30.208665 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:25:30.209667 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:25:30.211638 [info ] [Thread-1 (]: 10 of 32 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:25:30.211638 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:25:30.213185 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:25:30.220981 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:25:30.222033 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:25:30.225474 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:25:30.227486 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:25:30.228483 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:25:30.228483 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.229483 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.229987 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:25:30.229987 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.234156 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:25:30.235337 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:25:30.237860 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:25:30.239484 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:25:30.239484 [info ] [Thread-1 (]: 10 of 32 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.03s]
[0m06:25:30.240992 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:25:30.242003 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:25:30.243195 [info ] [Thread-1 (]: 11 of 32 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:25:30.243719 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:25:30.244749 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:25:30.251037 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:25:30.251591 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:25:30.254655 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:25:30.256163 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:25:30.256163 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:25:30.256163 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.257166 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.257166 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:25:30.258166 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.267973 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m06:25:30.269480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:25:30.270515 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:25:30.270515 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:25:30.270515 [info ] [Thread-1 (]: 11 of 32 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:25:30.270515 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:25:30.272135 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:25:30.272135 [info ] [Thread-1 (]: 12 of 32 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:25:30.273142 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:25:30.273142 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:25:30.277533 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:25:30.279069 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:25:30.281845 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:25:30.283369 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:25:30.283876 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:25:30.284396 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.284918 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.285444 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:25:30.285444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.292088 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:25:30.294659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:25:30.295670 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:25:30.296179 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:25:30.296179 [info ] [Thread-1 (]: 12 of 32 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:25:30.297389 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:25:30.297389 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:25:30.297389 [info ] [Thread-1 (]: 13 of 32 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:25:30.298949 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:25:30.299551 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:25:30.303721 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:25:30.304729 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:25:30.308250 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:25:30.309756 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:25:30.310898 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:25:30.310898 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.311907 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.311907 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:25:30.311907 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.316876 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:25:30.317881 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:25:30.318884 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:25:30.318884 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:25:30.320197 [info ] [Thread-1 (]: 13 of 32 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:25:30.320704 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:25:30.320704 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:25:30.322634 [info ] [Thread-1 (]: 14 of 32 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:25:30.323311 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:25:30.323817 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:25:30.327405 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:25:30.327915 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:25:30.331022 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:25:30.332292 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:25:30.332292 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:25:30.332874 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.333421 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.333421 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:25:30.334150 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.339274 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:25:30.341276 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:25:30.342286 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:25:30.342286 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:25:30.343294 [info ] [Thread-1 (]: 14 of 32 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:25:30.343294 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:25:30.343294 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:25:30.343294 [info ] [Thread-1 (]: 15 of 32 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:25:30.345053 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:25:30.345053 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:25:30.348720 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:25:30.349863 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:25:30.351483 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:25:30.353026 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:25:30.353026 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:25:30.353026 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.354032 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.354032 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:25:30.354032 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.363214 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:25:30.363214 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:25:30.365215 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:25:30.365215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:25:30.365824 [info ] [Thread-1 (]: 15 of 32 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:25:30.366457 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:25:30.366981 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:25:30.366981 [info ] [Thread-1 (]: 16 of 32 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:25:30.366981 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:25:30.367987 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:25:30.373311 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:25:30.373311 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:25:30.375358 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:25:30.377373 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:25:30.378418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:25:30.378418 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.379417 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.379417 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:25:30.380028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.383276 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:25:30.384788 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:25:30.385482 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:25:30.386511 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:25:30.386511 [info ] [Thread-1 (]: 16 of 32 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:25:30.387487 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:25:30.387487 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:25:30.388013 [info ] [Thread-1 (]: 17 of 32 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:25:30.388588 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:25:30.388588 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:25:30.392342 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:25:30.393352 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:25:30.394933 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:25:30.394933 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:25:30.396591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:25:30.396591 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.397117 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.397634 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:25:30.397634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.401857 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:25:30.402863 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:25:30.404370 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:25:30.404370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:25:30.404370 [info ] [Thread-1 (]: 17 of 32 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:25:30.405373 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:25:30.405373 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:25:30.406379 [info ] [Thread-1 (]: 18 of 32 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:25:30.406379 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:25:30.406379 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:25:30.411479 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:25:30.411479 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:25:30.412989 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:25:30.414549 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:25:30.415554 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:25:30.415554 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.416561 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.416561 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:25:30.417101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:25:30.420178 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:25:30.420684 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:25:30.422302 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:25:30.422302 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:25:30.423310 [info ] [Thread-1 (]: 18 of 32 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:25:30.424320 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:25:30.424320 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:25:30.424856 [info ] [Thread-1 (]: 19 of 32 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:25:30.425465 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:25:30.425465 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:25:30.428977 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:25:30.429984 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:25:30.432037 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:25:30.433606 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:25:30.434231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:25:30.434859 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.435443 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.436480 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:25:30.436480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.437467 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.438675 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:25:30.439696 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:25:30.439696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:25:30.439696 [info ] [Thread-1 (]: 19 of 32 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m06:25:30.440686 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:25:30.441189 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:25:30.441189 [info ] [Thread-1 (]: 20 of 32 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:25:30.442711 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:25:30.443219 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:25:30.446890 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:25:30.448399 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:25:30.451564 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:25:30.453082 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:25:30.453597 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:25:30.453597 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.454604 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.454604 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:25:30.454604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.461944 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:25:30.466572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:25:30.467578 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:25:30.467578 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:25:30.469204 [info ] [Thread-1 (]: 20 of 32 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m06:25:30.470024 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:25:30.470567 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:25:30.470567 [info ] [Thread-1 (]: 21 of 32 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:25:30.470567 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:25:30.472097 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:25:30.476137 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:25:30.478147 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:25:30.480173 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:25:30.481687 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:25:30.481687 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:25:30.483282 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.483895 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.483895 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:25:30.484905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.488552 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:25:30.489755 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:25:30.490282 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:25:30.490825 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:25:30.490825 [info ] [Thread-1 (]: 21 of 32 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:25:30.490825 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:25:30.492435 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:25:30.492435 [info ] [Thread-1 (]: 22 of 32 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:25:30.493443 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:25:30.493948 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:25:30.497578 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:25:30.499091 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:25:30.500702 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:25:30.501750 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:25:30.501750 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:25:30.502757 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.502757 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.502757 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:25:30.503757 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.505801 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:25:30.506806 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:25:30.507830 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:25:30.507830 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:25:30.508832 [info ] [Thread-1 (]: 22 of 32 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:25:30.508832 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:25:30.509805 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:25:30.510322 [info ] [Thread-1 (]: 23 of 32 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:25:30.510322 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:25:30.510833 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:25:30.514354 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:25:30.515367 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:25:30.516878 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:25:30.518396 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:25:30.518396 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:25:30.518910 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.518910 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.518910 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:25:30.519915 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.522428 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:25:30.523432 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:25:30.525041 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:25:30.525041 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:25:30.525041 [info ] [Thread-1 (]: 23 of 32 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:25:30.526054 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:25:30.527055 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:25:30.527055 [info ] [Thread-1 (]: 24 of 32 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:25:30.528053 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:25:30.528053 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:25:30.532083 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:25:30.533736 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:25:30.535524 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:25:30.535524 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:25:30.536535 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:25:30.536535 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.537536 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.538043 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:25:30.538043 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.542131 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:25:30.544144 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:25:30.544658 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:25:30.544658 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:25:30.544658 [info ] [Thread-1 (]: 24 of 32 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:25:30.546914 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:25:30.546914 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:25:30.548501 [info ] [Thread-1 (]: 25 of 32 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:25:30.549090 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:25:30.549627 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:25:30.556356 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:25:30.557359 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:25:30.559904 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:25:30.560532 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:25:30.560532 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:25:30.560532 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.562062 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.563076 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:25:30.563076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.564596 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.565603 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:25:30.566617 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:25:30.566617 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:25:30.566617 [info ] [Thread-1 (]: 25 of 32 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:25:30.567621 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:25:30.567621 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:25:30.569126 [info ] [Thread-1 (]: 26 of 32 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:25:30.569126 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:25:30.569126 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:25:30.574345 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:25:30.575511 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:25:30.577516 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:25:30.579021 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:25:30.579021 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:25:30.579021 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.580028 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.580534 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:25:30.580534 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.582674 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:25:30.583740 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:25:30.584392 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:25:30.585408 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:25:30.585408 [info ] [Thread-1 (]: 26 of 32 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:25:30.586457 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:25:30.586457 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:25:30.586457 [info ] [Thread-1 (]: 27 of 32 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:25:30.587458 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:25:30.587962 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:25:30.589550 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:25:30.591074 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:25:30.594895 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:25:30.595911 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:25:30.596417 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:25:30.596961 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.596961 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.597967 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:25:30.597967 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:25:30.601329 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:25:30.604092 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:25:30.604653 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:25:30.605738 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:25:30.606262 [info ] [Thread-1 (]: 27 of 32 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m06:25:30.607268 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:25:30.607268 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:25:30.607268 [info ] [Thread-1 (]: 28 of 32 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:25:30.608269 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:25:30.608269 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:25:30.611970 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:25:30.613475 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:25:30.614536 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:25:30.616562 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:25:30.617267 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:25:30.618280 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.619435 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.619435 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:25:30.619435 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.621121 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.622635 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:25:30.623141 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:25:30.623141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:25:30.624148 [info ] [Thread-1 (]: 28 of 32 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.02s]
[0m06:25:30.624653 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:25:30.625833 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:25:30.626413 [info ] [Thread-1 (]: 29 of 32 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:25:30.626413 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:25:30.627413 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:25:30.633649 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:25:30.635162 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:25:30.638308 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:25:30.639315 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:25:30.639315 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:25:30.639315 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.640821 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.640821 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:25:30.640821 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.642441 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:25:30.643980 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:25:30.644502 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:25:30.645034 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:25:30.645034 [info ] [Thread-1 (]: 29 of 32 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.02s]
[0m06:25:30.646544 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:25:30.646544 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:25:30.647112 [info ] [Thread-1 (]: 30 of 32 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:25:30.647112 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:25:30.647112 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:25:30.651913 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:25:30.653425 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:25:30.653942 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:25:30.655452 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:25:30.656457 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:25:30.656457 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.656457 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.656457 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:25:30.657843 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.661956 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:25:30.664425 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:25:30.665535 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:25:30.667050 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:25:30.668061 [info ] [Thread-1 (]: 30 of 32 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:25:30.669060 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:25:30.670230 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:25:30.670738 [info ] [Thread-1 (]: 31 of 32 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:25:30.670738 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:25:30.672262 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:25:30.677263 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:25:30.679267 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:25:30.681289 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:25:30.682312 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:25:30.682312 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:25:30.682312 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.683319 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.683827 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:25:30.683827 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:25:30.691030 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:25:30.692418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:25:30.693940 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:25:30.693940 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:25:30.694946 [info ] [Thread-1 (]: 31 of 32 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:25:30.694946 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:25:30.696462 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:25:30.697054 [info ] [Thread-1 (]: 32 of 32 START sql view model main.view_resumo_financeiro_relatorios ........... [RUN]
[0m06:25:30.697054 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios)
[0m06:25:30.697054 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:25:30.699794 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:25:30.701449 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:25:30.714378 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:25:30.715388 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:25:30.715388 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: BEGIN
[0m06:25:30.716393 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:25:30.716898 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:25:30.716898 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:25:30.717411 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.nome as nome_instituicao,
    i.segmento,
    i.cidade,
    i.uf,
    i.regiao,
    i.tipo_de_controle,
    i.consolidado_bancario,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Data
    t.data_base,
    t.ano,
    t.trimestre,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
  );

[0m06:25:30.723572 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.nome as nome_instituicao,
    i.segmento,
    i.cidade,
    i.uf,
    i.regiao,
    i.tipo_de_controle,
    i.consolidado_bancario,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Data
    t.data_base,
    t.ano,
    t.trimestre,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
  );

[0m06:25:30.724585 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:25:30.724585 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: ROLLBACK
[0m06:25:30.840251 [debug] [Thread-1 (]: Failed to rollback 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios'
[0m06:25:30.840799 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: Close
[0m06:25:30.842914 [debug] [Thread-1 (]: Runtime Error in model view_resumo_financeiro_relatorios (models\gold\view_resumo_financeiro_relatorios.sql)
  Binder Error: Values list "i" does not have a column named "segmento"
  
  LINE 23:     i.segmento,
               ^
[0m06:25:30.842914 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '20a22bc0-2a5d-4c89-b8ad-fcd4fec966ac', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD43B6060>]}
[0m06:25:30.843439 [error] [Thread-1 (]: 32 of 32 ERROR creating sql view model main.view_resumo_financeiro_relatorios .. [[31mERROR[0m in 0.15s]
[0m06:25:30.843439 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:25:30.843439 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' to be skipped because of status 'error'.  Reason: Runtime Error in model view_resumo_financeiro_relatorios (models\gold\view_resumo_financeiro_relatorios.sql)
  Binder Error: Values list "i" does not have a column named "segmento"
  
  LINE 23:     i.segmento,
               ^.
[0m06:25:30.846125 [debug] [MainThread]: Using duckdb connection "master"
[0m06:25:30.846125 [debug] [MainThread]: On master: BEGIN
[0m06:25:30.846125 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:25:30.847145 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:25:30.847145 [debug] [MainThread]: On master: COMMIT
[0m06:25:30.847145 [debug] [MainThread]: Using duckdb connection "master"
[0m06:25:30.847145 [debug] [MainThread]: On master: COMMIT
[0m06:25:30.847145 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:25:30.847145 [debug] [MainThread]: On master: Close
[0m06:25:30.847145 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:25:30.848872 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:25:30.848872 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:25:30.848872 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' was properly closed.
[0m06:25:30.849469 [info ] [MainThread]: 
[0m06:25:30.849469 [info ] [MainThread]: Finished running 3 table models, 28 data tests, 1 view model in 0 hours 0 minutes and 6.28 seconds (6.28s).
[0m06:25:30.852606 [debug] [MainThread]: Command end result
[0m06:25:30.937825 [debug] [MainThread]: Wrote artifact WritableManifest to src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:25:30.941072 [debug] [MainThread]: Wrote artifact SemanticManifest to src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:25:30.947013 [debug] [MainThread]: Wrote artifact RunExecutionResult to src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:25:30.947013 [info ] [MainThread]: 
[0m06:25:30.948032 [info ] [MainThread]: [31mCompleted with 1 error, 0 partial successes, and 0 warnings:[0m
[0m06:25:30.948032 [info ] [MainThread]: 
[0m06:25:30.948538 [error] [MainThread]: [31mFailure in model view_resumo_financeiro_relatorios (models\gold\view_resumo_financeiro_relatorios.sql)[0m
[0m06:25:30.948538 [error] [MainThread]:   Runtime Error in model view_resumo_financeiro_relatorios (models\gold\view_resumo_financeiro_relatorios.sql)
  Binder Error: Values list "i" does not have a column named "segmento"
  
  LINE 23:     i.segmento,
               ^
[0m06:25:30.949112 [info ] [MainThread]: 
[0m06:25:30.949112 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\view_resumo_financeiro_relatorios.sql
[0m06:25:30.949697 [info ] [MainThread]: 
[0m06:25:30.949697 [info ] [MainThread]: Done. PASS=31 WARN=0 ERROR=1 SKIP=0 NO-OP=0 TOTAL=32
[0m06:25:30.949697 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 22 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:25:30.951224 [debug] [MainThread]: Command `dbt build` failed at 06:25:30.951224 after 13.38 seconds
[0m06:25:30.951224 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD1BE22A0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD1BE1610>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000017AD209B980>]}
[0m06:25:30.951770 [debug] [MainThread]: Flushing usage events
[0m06:25:31.581645 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:26:21.486378 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F1F6B9190>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F1F910F20>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F1C03EB40>]}


============================== 06:26:21.492121 | 73c6cbd1-706d-4382-867e-7ab86e64f938 ==============================
[0m06:26:21.492121 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:26:21.493236 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'use_colors': 'True', 'indirect_selection': 'eager', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:26:21.679607 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F211529F0>]}
[0m06:26:21.727215 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F1FFAB350>]}
[0m06:26:21.729720 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:26:21.934366 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:26:22.081951 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
[0m06:26:22.082977 [debug] [MainThread]: Nothing changed, skipping partial parsing.
[0m06:26:22.082977 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing
[0m06:26:22.087911 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:26:22.122443 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F21267DA0>]}
[0m06:26:22.193780 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:26:22.196560 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:26:22.278059 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F215F7EC0>]}
[0m06:26:22.279567 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:26:22.284653 [info ] [MainThread]: 
[0m06:26:22.284653 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:26:22.285239 [info ] [MainThread]: 
[0m06:26:22.285239 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:26:22.289401 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:26:22.351742 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:26:22.351742 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:26:22.351742 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:26:22.438662 [debug] [ThreadPool]: SQL status: OK in 0.086 seconds
[0m06:26:22.440666 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:26:22.441170 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:26:22.442677 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:26:22.449647 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:26:22.449647 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:26:22.450823 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:26:22.451475 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:26:22.452477 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:26:22.452477 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:26:22.452477 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:26:22.452477 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:26:22.452477 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:26:22.452477 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:26:22.453980 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:26:22.453980 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:26:22.453980 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:26:22.453980 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:26:22.453980 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:26:22.456814 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:26:22.461065 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:26:22.461065 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:26:22.462068 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:26:22.462068 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:26:22.462068 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:26:22.462068 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:26:22.472152 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m06:26:22.473676 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:26:22.474828 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:26:22.474828 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:26:22.478432 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F2117B8C0>]}
[0m06:26:22.478432 [debug] [MainThread]: Using duckdb connection "master"
[0m06:26:22.478432 [debug] [MainThread]: On master: BEGIN
[0m06:26:22.479432 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:26:22.479432 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:26:22.479934 [debug] [MainThread]: On master: COMMIT
[0m06:26:22.479934 [debug] [MainThread]: Using duckdb connection "master"
[0m06:26:22.479934 [debug] [MainThread]: On master: COMMIT
[0m06:26:22.479934 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:26:22.479934 [debug] [MainThread]: On master: Close
[0m06:26:22.483555 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:26:22.483555 [info ] [Thread-1 (]: 1 of 32 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:26:22.484110 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:26:22.484110 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:26:22.497116 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:22.498128 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:26:22.517997 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:22.518996 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:22.518996 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:26:22.518996 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:26:22.520737 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:22.520737 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:22.520737 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN '1 - Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN '2 - Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN '3 - Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN '4 - Instituições com Operações de Câmbio'
            ELSE 'Outros'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:26:22.996890 [debug] [Thread-1 (]: SQL status: OK in 0.475 seconds
[0m06:26:23.001641 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:23.001641 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:26:23.002656 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.004171 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:23.004171 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:26:23.004171 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.010424 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:23.010424 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:26:23.011151 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.013186 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:23.013186 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:26:23.014198 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.024890 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:26:23.025547 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:23.025547 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:26:23.043054 [debug] [Thread-1 (]: SQL status: OK in 0.018 seconds
[0m06:26:23.049191 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:26:23.049713 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:26:23.050716 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.051918 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:26:23.054044 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F211C9F70>]}
[0m06:26:23.055700 [info ] [Thread-1 (]: 1 of 32 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.57s]
[0m06:26:23.055700 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:26:23.055700 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:26:23.056706 [info ] [Thread-1 (]: 2 of 32 START sql table model main.dim_tempo ................................... [RUN]
[0m06:26:23.057706 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:26:23.057706 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:26:23.066783 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.067787 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:26:23.069919 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.070941 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.070941 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:26:23.070941 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.072824 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.072824 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.073331 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:26:23.157189 [debug] [Thread-1 (]: SQL status: OK in 0.084 seconds
[0m06:26:23.158195 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.158195 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:26:23.159701 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.160706 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.161211 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:26:23.161211 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.165249 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.165830 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:26:23.166442 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.168031 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.168031 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:26:23.169010 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.169010 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:26:23.170781 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.170781 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:26:23.172306 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.173328 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:26:23.173328 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:26:23.173328 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.175817 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:26:23.176842 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F21B6D280>]}
[0m06:26:23.176842 [info ] [Thread-1 (]: 2 of 32 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.12s]
[0m06:26:23.177822 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:26:23.177822 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:26:23.177822 [info ] [Thread-1 (]: 3 of 32 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m06:26:23.179325 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:26:23.179325 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:26:23.183487 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.184663 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:26:23.186281 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.188463 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.188463 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:26:23.188463 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.189470 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.189470 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.190975 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:26:23.491574 [debug] [Thread-1 (]: SQL status: OK in 0.300 seconds
[0m06:26:23.492075 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.492075 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:26:23.493079 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.493581 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.494582 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:26:23.496154 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.498373 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.498876 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m06:26:23.498876 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.500886 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.501413 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:26:23.501413 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.502418 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:26:23.502418 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.502418 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:26:23.678275 [debug] [Thread-1 (]: SQL status: OK in 0.174 seconds
[0m06:26:23.679824 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:26:23.679824 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:26:23.682006 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:23.683582 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:26:23.684115 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F21B6FAD0>]}
[0m06:26:23.684115 [info ] [Thread-1 (]: 3 of 32 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.51s]
[0m06:26:23.684115 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:26:23.685559 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:26:23.685559 [info ] [Thread-1 (]: 4 of 32 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:26:23.686564 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:26:23.686564 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:26:23.695793 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:26:23.697003 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:26:23.708917 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:26:23.709896 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:26:23.710400 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:26:23.710400 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.711080 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.711080 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:26:23.711080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.712083 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.714699 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:26:23.715248 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:26:23.715854 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:26:23.715854 [info ] [Thread-1 (]: 4 of 32 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m06:26:23.716439 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:26:23.716439 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:26:23.717079 [info ] [Thread-1 (]: 5 of 32 START test not_null_dim_instituicao_id_localizacao ..................... [RUN]
[0m06:26:23.717079 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:26:23.717079 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:26:23.720872 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:26:23.721232 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:26:23.723244 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:26:23.724828 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:26:23.724828 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:26:23.725510 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.725510 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.725510 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:26:23.725510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.726546 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.727542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:26:23.727542 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:26:23.729103 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:26:23.729103 [info ] [Thread-1 (]: 5 of 32 PASS not_null_dim_instituicao_id_localizacao ........................... [[32mPASS[0m in 0.01s]
[0m06:26:23.729692 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:26:23.729692 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:26:23.729692 [info ] [Thread-1 (]: 6 of 32 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:26:23.729692 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:26:23.731227 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:26:23.736416 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:26:23.737922 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:26:23.741102 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:26:23.742615 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:26:23.742615 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:26:23.743120 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.743120 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.743120 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:26:23.743120 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.746242 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:23.748517 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:26:23.749152 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:26:23.749702 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:26:23.749702 [info ] [Thread-1 (]: 6 of 32 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:26:23.749702 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:26:23.750707 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:26:23.750707 [info ] [Thread-1 (]: 7 of 32 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:26:23.751213 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:26:23.751213 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:26:23.756422 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:26:23.757423 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:26:23.758955 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:26:23.759994 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:26:23.760500 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:26:23.760500 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.760500 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.761504 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:26:23.761504 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.763019 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.763019 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:26:23.764578 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:26:23.764578 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:26:23.765608 [info ] [Thread-1 (]: 7 of 32 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m06:26:23.766184 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:26:23.766184 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:26:23.766718 [info ] [Thread-1 (]: 8 of 32 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:26:23.766718 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:26:23.766718 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:26:23.770761 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:26:23.772376 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:26:23.775198 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:26:23.776204 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:26:23.776204 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:26:23.777205 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.777205 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.778204 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:26:23.778204 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.780770 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:23.781769 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:26:23.783349 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:26:23.783349 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:26:23.783949 [info ] [Thread-1 (]: 8 of 32 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m06:26:23.783949 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:26:23.784963 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:26:23.785469 [info ] [Thread-1 (]: 9 of 32 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:26:23.785469 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:26:23.785469 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:26:23.790098 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:26:23.791103 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:26:23.792139 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:26:23.793216 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:26:23.793216 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:26:23.793216 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.793216 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.794914 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:26:23.794914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.796657 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:23.797387 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:26:23.799068 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:26:23.799068 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:26:23.799616 [info ] [Thread-1 (]: 9 of 32 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.01s]
[0m06:26:23.799616 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:26:23.799616 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:26:23.799616 [info ] [Thread-1 (]: 10 of 32 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:26:23.800951 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:26:23.801545 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:26:23.804634 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:26:23.805633 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:26:23.807686 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:26:23.808670 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:26:23.808670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:26:23.808670 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.808670 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.808670 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:26:23.810194 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.811779 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.811779 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:26:23.813299 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:26:23.813299 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:26:23.813299 [info ] [Thread-1 (]: 10 of 32 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.01s]
[0m06:26:23.814328 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:26:23.814328 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:26:23.814328 [info ] [Thread-1 (]: 11 of 32 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:26:23.815606 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:26:23.815606 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:26:23.820893 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:26:23.820893 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:26:23.823430 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:26:23.824824 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:26:23.825548 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:26:23.825548 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.826552 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.826552 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:26:23.827568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.834028 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:26:23.835535 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:26:23.835535 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:26:23.836559 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:26:23.836559 [info ] [Thread-1 (]: 11 of 32 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:26:23.837540 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:26:23.837540 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:26:23.838123 [info ] [Thread-1 (]: 12 of 32 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:26:23.838123 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:26:23.838710 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:26:23.842251 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:26:23.843256 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:26:23.844768 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:26:23.844768 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:26:23.846341 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:26:23.846927 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.846927 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.846927 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:26:23.846927 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.852816 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:26:23.853799 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:26:23.855371 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:26:23.855371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:26:23.855371 [info ] [Thread-1 (]: 12 of 32 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:26:23.855371 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:26:23.856898 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:26:23.856898 [info ] [Thread-1 (]: 13 of 32 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:26:23.857901 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:26:23.857901 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:26:23.861130 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:26:23.862155 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:26:23.863142 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:26:23.864769 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:26:23.865355 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:26:23.865355 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.865355 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.866359 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:26:23.866359 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.869024 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:26:23.870680 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:26:23.871716 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:26:23.871716 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:26:23.872226 [info ] [Thread-1 (]: 13 of 32 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:26:23.872226 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:26:23.873230 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:26:23.873230 [info ] [Thread-1 (]: 14 of 32 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:26:23.873230 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:26:23.873230 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:26:23.878147 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:26:23.879145 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:26:23.879649 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:26:23.881864 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:26:23.881864 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:26:23.881864 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.883483 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.883483 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:26:23.884080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.887580 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:26:23.888263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:26:23.889272 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:26:23.890269 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:26:23.890269 [info ] [Thread-1 (]: 14 of 32 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:26:23.890269 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:26:23.891267 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:26:23.891267 [info ] [Thread-1 (]: 15 of 32 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:26:23.891267 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:26:23.891267 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:26:23.895080 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:26:23.896559 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:26:23.898419 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:26:23.899388 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:26:23.901017 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:26:23.901391 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.901391 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.901391 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:26:23.901391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.908674 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:26:23.910587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:26:23.910911 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:26:23.911594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:26:23.911594 [info ] [Thread-1 (]: 15 of 32 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:26:23.912593 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:26:23.912593 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:26:23.912593 [info ] [Thread-1 (]: 16 of 32 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:26:23.913593 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:26:23.913593 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:26:23.917123 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:26:23.917745 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:26:23.919266 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:26:23.920851 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:26:23.921338 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:26:23.921878 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.921878 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.921878 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:26:23.921878 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.925011 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:23.925647 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:26:23.926753 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:26:23.926753 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:26:23.927755 [info ] [Thread-1 (]: 16 of 32 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:26:23.927755 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:26:23.927755 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:26:23.927755 [info ] [Thread-1 (]: 17 of 32 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:26:23.929259 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:26:23.929259 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:26:23.933229 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:26:23.934231 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:26:23.935741 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:26:23.936340 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:26:23.937845 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:26:23.937845 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.938428 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.938428 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:26:23.939944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.943600 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:26:23.944604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:26:23.944604 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:26:23.946418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:26:23.946962 [info ] [Thread-1 (]: 17 of 32 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:26:23.946962 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:26:23.946962 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:26:23.946962 [info ] [Thread-1 (]: 18 of 32 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:26:23.946962 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:26:23.948470 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:26:23.952932 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:26:23.954438 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:26:23.955455 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:26:23.956499 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:26:23.956499 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:26:23.957464 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.957464 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.957464 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:26:23.958483 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:26:23.960638 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:23.962154 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:26:23.963653 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:26:23.963653 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:26:23.963653 [info ] [Thread-1 (]: 18 of 32 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:26:23.964658 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:26:23.964658 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:26:23.964658 [info ] [Thread-1 (]: 19 of 32 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:26:23.965663 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:26:23.965663 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:26:23.968773 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:26:23.969344 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:26:23.970912 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:26:23.972432 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:26:23.972432 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:26:23.972432 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.973437 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:23.973437 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:26:23.973437 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.974443 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.974948 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:26:23.976459 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:26:23.976459 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:26:23.976459 [info ] [Thread-1 (]: 19 of 32 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m06:26:23.977466 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:26:23.977466 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:26:23.978463 [info ] [Thread-1 (]: 20 of 32 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:23.978463 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:26:23.978463 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:26:23.983663 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:26:23.984843 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:26:23.987640 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:26:23.988236 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:26:23.989244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:26:23.989244 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:23.990243 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:23.990243 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:26:23.991245 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:23.995267 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:26:23.996474 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:26:23.997159 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:26:23.997159 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:26:23.997159 [info ] [Thread-1 (]: 20 of 32 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:26:23.998785 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:26:23.998785 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:26:23.999372 [info ] [Thread-1 (]: 21 of 32 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:23.999372 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:26:23.999372 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:26:24.003654 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:26:24.004778 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:26:24.005957 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:26:24.006961 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:26:24.006961 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:26:24.006961 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.008067 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.008067 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:26:24.008067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.010577 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:24.012165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:26:24.012165 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:26:24.013196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:26:24.013727 [info ] [Thread-1 (]: 21 of 32 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:26:24.014233 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:26:24.014233 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:26:24.014233 [info ] [Thread-1 (]: 22 of 32 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:24.015237 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:26:24.015237 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:26:24.018967 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:26:24.019975 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:26:24.021985 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:26:24.021985 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:26:24.022989 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:26:24.022989 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.022989 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.022989 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:26:24.022989 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.026371 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:24.027371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:26:24.027371 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:26:24.027371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:26:24.028818 [info ] [Thread-1 (]: 22 of 32 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:26:24.029342 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:26:24.029342 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:26:24.029946 [info ] [Thread-1 (]: 23 of 32 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:24.029946 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:26:24.030953 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:26:24.034373 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:26:24.035932 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:26:24.038026 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:26:24.038604 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:26:24.038604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:26:24.038604 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.039636 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.039636 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:26:24.039636 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.042147 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:24.043157 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:26:24.043157 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:26:24.044788 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:26:24.044788 [info ] [Thread-1 (]: 23 of 32 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:26:24.044788 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:26:24.044788 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:26:24.044788 [info ] [Thread-1 (]: 24 of 32 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:24.046498 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:26:24.046498 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:26:24.049373 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:26:24.051606 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:26:24.052637 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:26:24.054136 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:26:24.054136 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:26:24.054136 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.054136 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.054136 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:26:24.055843 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.058860 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:26:24.059855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:26:24.060914 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:26:24.060914 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:26:24.060914 [info ] [Thread-1 (]: 24 of 32 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:26:24.061945 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:26:24.061945 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:26:24.061945 [info ] [Thread-1 (]: 25 of 32 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:24.061945 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:26:24.063452 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:26:24.067792 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:26:24.068789 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:26:24.069391 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:26:24.071032 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:26:24.071032 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:26:24.072045 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.072594 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.072594 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:26:24.073114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.073114 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:24.075272 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:26:24.076278 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:26:24.076278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:26:24.076278 [info ] [Thread-1 (]: 25 of 32 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:26:24.077283 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:26:24.077283 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:26:24.077283 [info ] [Thread-1 (]: 26 of 32 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:24.078312 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:26:24.078312 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:26:24.082263 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:26:24.082263 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:26:24.083779 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:26:24.085306 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:26:24.085306 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:26:24.085306 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.086323 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.086323 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:26:24.086323 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.088468 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:24.089497 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:26:24.090027 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:26:24.090027 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:26:24.091049 [info ] [Thread-1 (]: 26 of 32 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:26:24.091049 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:26:24.091049 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:26:24.092194 [info ] [Thread-1 (]: 27 of 32 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:26:24.092194 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:26:24.092194 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:26:24.094711 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:26:24.096346 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:26:24.097400 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:26:24.097400 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:26:24.099150 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:26:24.099150 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.099729 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.099729 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:26:24.099729 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:26:24.101242 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:24.102020 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:26:24.103032 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:26:24.103032 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:26:24.103032 [info ] [Thread-1 (]: 27 of 32 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m06:26:24.104032 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:26:24.104032 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:26:24.104032 [info ] [Thread-1 (]: 28 of 32 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:26:24.105155 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:26:24.105664 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:26:24.107682 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:26:24.108682 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:26:24.109685 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:26:24.110734 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:26:24.111748 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:26:24.111748 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.113251 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:26:24.113251 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:26:24.113251 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.114275 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.115363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:26:24.115363 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:26:24.116383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:26:24.116383 [info ] [Thread-1 (]: 28 of 32 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:26:24.117062 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:26:24.117062 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:26:24.118073 [info ] [Thread-1 (]: 29 of 32 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:26:24.118073 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:26:24.118073 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:26:24.120743 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:26:24.120743 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:26:24.123343 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:26:24.125033 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:26:24.125553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:26:24.125553 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.125553 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.126556 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:26:24.126556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.127558 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.128596 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:26:24.129117 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:26:24.129117 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:26:24.129117 [info ] [Thread-1 (]: 29 of 32 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:26:24.130147 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:26:24.130147 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:26:24.130147 [info ] [Thread-1 (]: 30 of 32 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:26:24.131223 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:26:24.131223 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:26:24.134545 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:26:24.135064 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:26:24.136092 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:26:24.137613 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:26:24.137613 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:26:24.138285 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.138285 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.138285 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:26:24.139313 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.140818 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:26:24.142537 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:26:24.143550 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:26:24.143550 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:26:24.143550 [info ] [Thread-1 (]: 30 of 32 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:26:24.144587 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:26:24.144587 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:26:24.144587 [info ] [Thread-1 (]: 31 of 32 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:26:24.144587 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:26:24.144587 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:26:24.149183 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:26:24.149866 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:26:24.151419 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:26:24.151419 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:26:24.152959 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:26:24.152959 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.152959 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.152959 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:26:24.153986 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:26:24.158197 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:26:24.159704 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:26:24.160712 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:26:24.160712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:26:24.161217 [info ] [Thread-1 (]: 31 of 32 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:26:24.161217 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:26:24.162222 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:26:24.162222 [info ] [Thread-1 (]: 32 of 32 START sql view model main.view_resumo_financeiro_relatorios ........... [RUN]
[0m06:26:24.163221 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios)
[0m06:26:24.163221 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:26:24.165446 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:26:24.166611 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:26:24.178122 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:26:24.178122 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:26:24.179104 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: BEGIN
[0m06:26:24.179104 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:26:24.179625 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:26:24.179625 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:26:24.179625 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.nome as nome_instituicao,
    i.segmento,
    i.cidade,
    i.uf,
    i.regiao,
    i.tipo_de_controle,
    i.consolidado_bancario,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Data
    t.data_base,
    t.ano,
    t.trimestre,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
  );

[0m06:26:24.181299 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.nome as nome_instituicao,
    i.segmento,
    i.cidade,
    i.uf,
    i.regiao,
    i.tipo_de_controle,
    i.consolidado_bancario,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Data
    t.data_base,
    t.ano,
    t.trimestre,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
  );

[0m06:26:24.181847 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:26:24.181847 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: ROLLBACK
[0m06:26:24.185415 [debug] [Thread-1 (]: Failed to rollback 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios'
[0m06:26:24.185415 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: Close
[0m06:26:24.187435 [debug] [Thread-1 (]: Runtime Error in model view_resumo_financeiro_relatorios (models\gold\view_resumo_financeiro_relatorios.sql)
  Binder Error: Values list "i" does not have a column named "segmento"
  
  LINE 23:     i.segmento,
               ^
[0m06:26:24.188104 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '73c6cbd1-706d-4382-867e-7ab86e64f938', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F21C017C0>]}
[0m06:26:24.188104 [error] [Thread-1 (]: 32 of 32 ERROR creating sql view model main.view_resumo_financeiro_relatorios .. [[31mERROR[0m in 0.03s]
[0m06:26:24.188774 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:26:24.188774 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' to be skipped because of status 'error'.  Reason: Runtime Error in model view_resumo_financeiro_relatorios (models\gold\view_resumo_financeiro_relatorios.sql)
  Binder Error: Values list "i" does not have a column named "segmento"
  
  LINE 23:     i.segmento,
               ^.
[0m06:26:24.190779 [debug] [MainThread]: Using duckdb connection "master"
[0m06:26:24.190779 [debug] [MainThread]: On master: BEGIN
[0m06:26:24.190779 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:26:24.190779 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:26:24.190779 [debug] [MainThread]: On master: COMMIT
[0m06:26:24.190779 [debug] [MainThread]: Using duckdb connection "master"
[0m06:26:24.190779 [debug] [MainThread]: On master: COMMIT
[0m06:26:24.192392 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:26:24.192727 [debug] [MainThread]: On master: Close
[0m06:26:24.192727 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:26:24.192727 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:26:24.193404 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:26:24.193404 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' was properly closed.
[0m06:26:24.193404 [info ] [MainThread]: 
[0m06:26:24.193404 [info ] [MainThread]: Finished running 3 table models, 28 data tests, 1 view model in 0 hours 0 minutes and 1.91 seconds (1.91s).
[0m06:26:24.196397 [debug] [MainThread]: Command end result
[0m06:26:24.224969 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:26:24.226480 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:26:24.232001 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:26:24.232001 [info ] [MainThread]: 
[0m06:26:24.232001 [info ] [MainThread]: [31mCompleted with 1 error, 0 partial successes, and 0 warnings:[0m
[0m06:26:24.233007 [info ] [MainThread]: 
[0m06:26:24.233007 [error] [MainThread]: [31mFailure in model view_resumo_financeiro_relatorios (models\gold\view_resumo_financeiro_relatorios.sql)[0m
[0m06:26:24.233511 [error] [MainThread]:   Runtime Error in model view_resumo_financeiro_relatorios (models\gold\view_resumo_financeiro_relatorios.sql)
  Binder Error: Values list "i" does not have a column named "segmento"
  
  LINE 23:     i.segmento,
               ^
[0m06:26:24.233511 [info ] [MainThread]: 
[0m06:26:24.234014 [info ] [MainThread]:   compiled code at target\compiled\bacen_ifdata_analytics\models\gold\view_resumo_financeiro_relatorios.sql
[0m06:26:24.234014 [info ] [MainThread]: 
[0m06:26:24.234014 [info ] [MainThread]: Done. PASS=31 WARN=0 ERROR=1 SKIP=0 NO-OP=0 TOTAL=32
[0m06:26:24.235020 [debug] [MainThread]: Command `dbt build` failed at 06:26:24.235020 after 2.94 seconds
[0m06:26:24.235584 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F1F910F20>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F1F0A79B0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022F1EA653D0>]}
[0m06:26:24.235584 [debug] [MainThread]: Flushing usage events
[0m06:26:24.875062 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:27:15.171070 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAD6A74A0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAD6E58E0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAD570140>]}


============================== 06:27:15.174727 | 3e077c1a-e09e-47c5-acaa-798a58fc1797 ==============================
[0m06:27:15.174727 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:27:15.175288 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios', 'indirect_selection': 'eager', 'use_colors': 'True', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:27:15.346213 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EADFC7BC0>]}
[0m06:27:15.393433 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EADF59EB0>]}
[0m06:27:15.394941 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:27:15.599910 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:27:15.728258 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed.
[0m06:27:15.728258 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\view_resumo_financeiro_relatorios.sql
[0m06:27:15.967578 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:27:16.021891 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAF48C6B0>]}
[0m06:27:16.096407 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:27:16.098519 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:27:16.155309 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAF484440>]}
[0m06:27:16.155309 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:27:16.159953 [info ] [MainThread]: 
[0m06:27:16.159953 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:27:16.160708 [info ] [MainThread]: 
[0m06:27:16.160708 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:27:16.164372 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:27:16.228248 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:27:16.228780 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:27:16.228780 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:27:16.350958 [debug] [ThreadPool]: SQL status: OK in 0.122 seconds
[0m06:27:16.351474 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:27:16.352494 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:27:16.352494 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:27:16.357363 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:27:16.357363 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:27:16.357363 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:27:16.358356 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:27:16.359876 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:27:16.359876 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:27:16.360443 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:27:16.360443 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:27:16.360443 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:27:16.360443 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:27:16.361454 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:27:16.361454 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:27:16.361454 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:27:16.361454 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:27:16.361454 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:27:16.364526 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:27:16.368567 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:27:16.369081 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:27:16.369081 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:27:16.369081 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:27:16.369081 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:27:16.369081 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:27:16.386732 [debug] [ThreadPool]: SQL status: OK in 0.017 seconds
[0m06:27:16.389260 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:27:16.392319 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:27:16.392319 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:27:16.396723 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EADED5940>]}
[0m06:27:16.397452 [debug] [MainThread]: Using duckdb connection "master"
[0m06:27:16.397452 [debug] [MainThread]: On master: BEGIN
[0m06:27:16.397452 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:27:16.398457 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:27:16.398457 [debug] [MainThread]: On master: COMMIT
[0m06:27:16.399013 [debug] [MainThread]: Using duckdb connection "master"
[0m06:27:16.399013 [debug] [MainThread]: On master: COMMIT
[0m06:27:16.399554 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:27:16.400582 [debug] [MainThread]: On master: Close
[0m06:27:16.409066 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:27:16.409066 [info ] [Thread-1 (]: 1 of 47 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:27:16.410072 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:27:16.410072 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:27:16.423878 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.424382 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:27:16.447412 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.447412 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.447412 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:27:16.447412 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:27:16.449261 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:16.449261 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.450377 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN '1 - Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN '2 - Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN '3 - Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN '4 - Instituições com Operações de Câmbio'
            ELSE 'Outros'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:27:16.907423 [debug] [Thread-1 (]: SQL status: OK in 0.456 seconds
[0m06:27:16.911464 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.911464 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:27:16.912466 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:16.913467 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.913977 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:27:16.914486 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:16.918691 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.919355 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:27:16.919355 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:16.920877 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.921887 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:27:16.922397 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:16.932209 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:27:16.932209 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.932209 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:27:16.945971 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m06:27:16.949911 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:16.950918 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:27:16.951937 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:16.954550 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:27:16.956561 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAE010B60>]}
[0m06:27:16.957561 [info ] [Thread-1 (]: 1 of 47 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.55s]
[0m06:27:16.957561 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:27:16.958560 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:27:16.958560 [info ] [Thread-1 (]: 2 of 47 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:27:16.959560 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:27:16.960110 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:27:16.963357 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:16.964795 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:27:16.967067 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:16.968169 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:16.968169 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:27:16.968169 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:16.969180 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:16.969180 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:16.969801 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:27:17.003888 [debug] [Thread-1 (]: SQL status: OK in 0.035 seconds
[0m06:27:17.005439 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:17.006471 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:27:17.006471 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.007995 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:17.007995 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:27:17.009009 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.010530 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:17.011535 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m06:27:17.011535 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.013040 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:17.013040 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:27:17.014654 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.014654 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:27:17.015699 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:17.015699 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:27:17.016886 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:17.020939 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:17.020939 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:27:17.021948 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.022956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:27:17.023461 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAFD677A0>]}
[0m06:27:17.023461 [info ] [Thread-1 (]: 2 of 47 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.06s]
[0m06:27:17.024466 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:27:17.024466 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:27:17.025005 [info ] [Thread-1 (]: 3 of 47 START sql table model main.dim_tempo ................................... [RUN]
[0m06:27:17.025005 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:27:17.025554 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:27:17.032100 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.033128 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:27:17.035807 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.036812 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.036812 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:27:17.036812 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.036812 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.037812 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.038317 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:27:17.090879 [debug] [Thread-1 (]: SQL status: OK in 0.052 seconds
[0m06:27:17.091996 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.091996 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:27:17.091996 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.093705 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.093705 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:27:17.094740 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.097002 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.097002 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:27:17.098036 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.099779 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.099779 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:27:17.099779 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.101818 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:27:17.101818 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.101818 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:27:17.103833 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:17.106489 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:17.106489 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:27:17.107460 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.108500 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:27:17.108500 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAFCCC980>]}
[0m06:27:17.110005 [info ] [Thread-1 (]: 3 of 47 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.08s]
[0m06:27:17.110005 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:27:17.110724 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:27:17.110724 [info ] [Thread-1 (]: 4 of 47 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m06:27:17.110724 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:27:17.110724 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:27:17.117677 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.119199 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:27:17.123198 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.123753 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.124293 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:27:17.124293 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.124865 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.124865 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.125597 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:27:17.377586 [debug] [Thread-1 (]: SQL status: OK in 0.253 seconds
[0m06:27:17.379710 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.379710 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:27:17.379710 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.381239 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.381856 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:27:17.381856 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.385315 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.385315 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m06:27:17.386326 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.388423 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.388423 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:27:17.388423 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.389977 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:27:17.389977 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.389977 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:27:17.566758 [debug] [Thread-1 (]: SQL status: OK in 0.177 seconds
[0m06:27:17.569403 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:17.569403 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:27:17.571439 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.572547 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:27:17.572547 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020ED07A2630>]}
[0m06:27:17.573152 [info ] [Thread-1 (]: 4 of 47 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.46s]
[0m06:27:17.573152 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:27:17.574164 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:27:17.574164 [info ] [Thread-1 (]: 5 of 47 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m06:27:17.574742 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:27:17.575300 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:27:17.575300 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:27:17.592309 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:27:17.592309 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:27:17.592309 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.593464 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.593464 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:27:17.593464 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m06:27:17.593464 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.601485 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:27:17.602492 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:27:17.606317 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:27:17.607197 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:27:17.607197 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: ROLLBACK
[0m06:27:17.650849 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_consolidado'
[0m06:27:17.651967 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:27:17.653532 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv"
[0m06:27:17.654064 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAFAF28A0>]}
[0m06:27:17.654064 [error] [Thread-1 (]: 5 of 47 ERROR loading seed file main.seed_dim_consolidado ...................... [[31mERROR[0m in 0.08s]
[0m06:27:17.654064 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:27:17.655570 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:27:17.655570 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_consolidado' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv".
[0m06:27:17.655570 [info ] [Thread-1 (]: 6 of 47 START seed file main.seed_dim_controle ................................. [RUN]
[0m06:27:17.656574 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:27:17.656574 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:27:17.657575 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:27:17.661612 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:27:17.661612 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:27:17.662589 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.663093 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.663093 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:27:17.663093 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m06:27:17.663093 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.665057 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:27:17.665057 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:27:17.666088 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:27:17.666601 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:27:17.667723 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: ROLLBACK
[0m06:27:17.673768 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_controle'
[0m06:27:17.674277 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:27:17.678793 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv"
[0m06:27:17.680301 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAFCBEEA0>]}
[0m06:27:17.681311 [error] [Thread-1 (]: 6 of 47 ERROR loading seed file main.seed_dim_controle ......................... [[31mERROR[0m in 0.02s]
[0m06:27:17.681821 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:27:17.682328 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:27:17.682328 [info ] [Thread-1 (]: 7 of 47 START seed file main.seed_dim_segmento ................................. [RUN]
[0m06:27:17.683569 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:27:17.684081 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:27:17.684081 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:27:17.686255 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_controle' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv".
[0m06:27:17.689429 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:27:17.689429 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:27:17.690934 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.690934 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.690934 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:27:17.690934 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m06:27:17.692609 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.693212 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:27:17.694218 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:27:17.694724 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:27:17.694724 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:27:17.694724 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: ROLLBACK
[0m06:27:17.699386 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_segmento'
[0m06:27:17.699386 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:27:17.701861 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv"
[0m06:27:17.702977 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3e077c1a-e09e-47c5-acaa-798a58fc1797', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020ED082EDB0>]}
[0m06:27:17.702977 [error] [Thread-1 (]: 7 of 47 ERROR loading seed file main.seed_dim_segmento ......................... [[31mERROR[0m in 0.02s]
[0m06:27:17.703868 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:27:17.704406 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:27:17.704406 [info ] [Thread-1 (]: 8 of 47 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:27:17.704406 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_segmento' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv".
[0m06:27:17.705411 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:27:17.705411 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:27:17.718976 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:27:17.720983 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:27:17.732288 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:27:17.733869 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:27:17.734373 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:27:17.734373 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.734373 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.734373 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:27:17.735377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.735377 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.738242 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:27:17.738555 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:27:17.739255 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:27:17.739255 [info ] [Thread-1 (]: 8 of 47 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m06:27:17.740255 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:27:17.740255 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:27:17.740255 [info ] [Thread-1 (]: 9 of 47 START test not_null_dim_instituicao_id_localizacao ..................... [RUN]
[0m06:27:17.741283 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:27:17.741283 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:27:17.743417 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:27:17.744961 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:27:17.747155 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:27:17.747155 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:27:17.747155 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:27:17.747155 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.748823 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.748823 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:27:17.749420 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.749420 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.751014 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:27:17.751703 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:27:17.751703 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:27:17.751703 [info ] [Thread-1 (]: 9 of 47 PASS not_null_dim_instituicao_id_localizacao ........................... [[32mPASS[0m in 0.01s]
[0m06:27:17.752715 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:27:17.752715 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:27:17.753715 [info ] [Thread-1 (]: 10 of 47 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:27:17.753715 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:27:17.753715 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:27:17.759901 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:27:17.760982 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:27:17.763003 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:27:17.763003 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:27:17.763003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:27:17.763003 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.764621 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.764621 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:27:17.764621 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.766766 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:17.767773 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:27:17.769278 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:27:17.769278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:27:17.769278 [info ] [Thread-1 (]: 10 of 47 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:17.769278 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:27:17.770966 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:27:17.770966 [info ] [Thread-1 (]: 11 of 47 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:17.770966 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:27:17.771971 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:27:17.776331 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:27:17.777309 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:27:17.777841 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:27:17.779362 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:27:17.780018 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:27:17.780018 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.780018 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.781024 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:27:17.781555 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.786483 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:27:17.787466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:27:17.787970 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:27:17.788671 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:27:17.788671 [info ] [Thread-1 (]: 11 of 47 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:17.789676 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:27:17.789676 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:27:17.789676 [info ] [Thread-1 (]: 12 of 47 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:17.789676 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:27:17.791179 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:27:17.796325 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:27:17.797065 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:27:17.798629 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:27:17.799258 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:27:17.799945 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:27:17.799945 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.799945 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.800948 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:27:17.800948 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.806609 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:27:17.807627 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:27:17.808610 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:27:17.808610 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:27:17.808610 [info ] [Thread-1 (]: 12 of 47 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:17.808610 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:27:17.808610 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:27:17.810715 [info ] [Thread-1 (]: 13 of 47 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:17.810715 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:27:17.811217 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:27:17.814407 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:27:17.815420 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:27:17.817937 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:27:17.818942 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:27:17.818942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:27:17.818942 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.819947 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.819947 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:27:17.819947 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.824761 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:27:17.825797 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:27:17.826961 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:27:17.826961 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:27:17.827961 [info ] [Thread-1 (]: 13 of 47 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:17.827961 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:27:17.827961 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:27:17.827961 [info ] [Thread-1 (]: 14 of 47 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:17.829470 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:27:17.830017 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:27:17.833715 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:27:17.834884 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:27:17.836581 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:27:17.837582 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:27:17.837582 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:27:17.837582 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.838256 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.838256 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:27:17.838256 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.842371 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:27:17.843966 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:27:17.844971 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:27:17.844971 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:27:17.844971 [info ] [Thread-1 (]: 14 of 47 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:17.845977 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:27:17.846482 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:27:17.846482 [info ] [Thread-1 (]: 15 of 47 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:17.847166 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:27:17.847166 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:27:17.850991 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:27:17.851627 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:27:17.852634 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:27:17.854139 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:27:17.854139 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:27:17.854139 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.854139 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.855780 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:27:17.855780 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.860923 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:27:17.862022 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:27:17.863027 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:27:17.863027 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:27:17.863027 [info ] [Thread-1 (]: 15 of 47 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:17.863027 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:27:17.863027 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:27:17.864757 [info ] [Thread-1 (]: 16 of 47 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:17.864757 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:27:17.864757 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:27:17.868032 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:27:17.869037 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:27:17.872187 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:27:17.873196 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:27:17.873196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:27:17.873196 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.873196 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.873196 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:27:17.874840 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.876659 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:17.877661 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:27:17.878166 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:27:17.878166 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:27:17.879171 [info ] [Thread-1 (]: 16 of 47 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:27:17.879171 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:27:17.879811 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:27:17.879811 [info ] [Thread-1 (]: 17 of 47 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:17.879811 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:27:17.880816 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:27:17.884291 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:27:17.884816 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:27:17.886400 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:27:17.886400 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:27:17.886400 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:27:17.887906 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.888488 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.888488 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:27:17.888488 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.892005 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:27:17.893515 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:27:17.894028 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:27:17.894028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:27:17.894028 [info ] [Thread-1 (]: 17 of 47 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:27:17.895034 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:27:17.895539 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:27:17.895539 [info ] [Thread-1 (]: 18 of 47 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:27:17.895539 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:27:17.896569 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:27:17.900918 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:27:17.901424 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:27:17.902434 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:27:17.904401 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:27:17.904815 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:27:17.904815 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.904815 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.904815 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:27:17.905841 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:17.907855 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:17.907855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:27:17.909380 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:27:17.909927 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:27:17.909927 [info ] [Thread-1 (]: 18 of 47 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.01s]
[0m06:27:17.910486 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:27:17.910486 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:27:17.911367 [info ] [Thread-1 (]: 19 of 47 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:27:17.911367 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:27:17.911367 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:27:17.914471 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:27:17.916023 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:27:17.917321 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:27:17.918831 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:27:17.919322 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:27:17.919322 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.919839 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.919839 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:27:17.919839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.919839 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.921934 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:27:17.921934 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:27:17.921934 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:27:17.923448 [info ] [Thread-1 (]: 19 of 47 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:27:17.923448 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:27:17.923448 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:27:17.923448 [info ] [Thread-1 (]: 20 of 47 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:27:17.923448 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:27:17.923448 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:27:17.927530 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:27:17.929037 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:27:17.930046 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:27:17.932082 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:27:17.933089 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:27:17.933593 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.934146 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.934146 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:27:17.934673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.936238 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.936238 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:27:17.937744 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:27:17.938327 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:27:17.938327 [info ] [Thread-1 (]: 20 of 47 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.01s]
[0m06:27:17.938327 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:27:17.939333 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:27:17.939333 [info ] [Thread-1 (]: 21 of 47 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:27:17.940333 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:27:17.940333 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:27:17.943806 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:27:17.944930 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:27:17.947476 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:27:17.949516 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:27:17.949516 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:27:17.949516 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.949516 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.949516 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:27:17.951732 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:17.953742 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:17.955295 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:27:17.955802 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:27:17.955802 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:27:17.957313 [info ] [Thread-1 (]: 21 of 47 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m06:27:17.957313 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:27:17.957313 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:27:17.958337 [info ] [Thread-1 (]: 22 of 47 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:27:17.958337 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:27:17.958337 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:27:17.961487 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:27:17.964797 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:27:17.965916 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:27:17.966683 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:27:17.967692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:27:17.967692 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.967692 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.968696 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:27:17.968696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.969246 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.969246 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:27:17.970843 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:27:17.970843 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:27:17.971871 [info ] [Thread-1 (]: 22 of 47 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m06:27:17.971871 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:27:17.971871 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:27:17.971871 [info ] [Thread-1 (]: 23 of 47 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:17.973406 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:27:17.973406 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:27:17.976555 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:27:17.977554 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:27:17.979061 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:27:17.980591 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:27:17.980591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:27:17.981155 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.981155 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:17.982161 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:27:17.982161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.985157 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:27:17.986180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:27:17.986180 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:27:17.986180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:27:17.987702 [info ] [Thread-1 (]: 23 of 47 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:17.988292 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:27:17.988292 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:27:17.988292 [info ] [Thread-1 (]: 24 of 47 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:17.988292 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:27:17.989297 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:27:17.992419 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:27:17.993427 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:27:17.995549 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:27:17.996616 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:27:17.996616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:27:17.997190 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:17.997190 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:17.997190 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:27:17.997190 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:17.999402 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:18.000977 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:27:18.001706 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:27:18.001706 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:27:18.002713 [info ] [Thread-1 (]: 24 of 47 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:18.002713 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:27:18.002713 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:27:18.003712 [info ] [Thread-1 (]: 25 of 47 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:18.003712 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:27:18.003712 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:27:18.006887 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:27:18.007888 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:27:18.009888 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:27:18.011996 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:27:18.011996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:27:18.011996 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.012996 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.012996 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:27:18.013501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.015540 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:18.016564 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:27:18.017238 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:27:18.017238 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:27:18.017238 [info ] [Thread-1 (]: 25 of 47 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:18.018244 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:27:18.018244 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:27:18.018748 [info ] [Thread-1 (]: 26 of 47 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:18.019385 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:27:18.019385 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:27:18.022410 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:27:18.023416 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:27:18.024928 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:27:18.026273 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:27:18.026781 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:27:18.026781 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.027288 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.027288 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:27:18.027288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.029798 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:18.029798 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:27:18.031541 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:27:18.031541 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:27:18.032248 [info ] [Thread-1 (]: 26 of 47 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:18.032248 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:27:18.032248 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:27:18.033277 [info ] [Thread-1 (]: 27 of 47 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:18.033823 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:27:18.033823 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:27:18.037873 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:27:18.038533 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:27:18.039540 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:27:18.041382 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:27:18.041382 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:27:18.041382 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.042387 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.042387 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:27:18.042387 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.044902 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:18.044902 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:27:18.047127 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:27:18.047127 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:27:18.047127 [info ] [Thread-1 (]: 27 of 47 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:18.047127 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:27:18.047127 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:27:18.048770 [info ] [Thread-1 (]: 28 of 47 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:18.049359 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:27:18.049359 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:27:18.052494 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:27:18.052494 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:27:18.054000 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:27:18.055622 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:27:18.055622 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:27:18.055622 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.057148 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.057148 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:27:18.057148 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.059153 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:18.060168 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:27:18.060876 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:27:18.060876 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:27:18.060876 [info ] [Thread-1 (]: 28 of 47 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:18.061904 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:27:18.061904 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:27:18.061904 [info ] [Thread-1 (]: 29 of 47 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:18.061904 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:27:18.061904 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:27:18.067039 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:27:18.067581 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:27:18.069119 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:27:18.069119 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:27:18.070731 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:27:18.070731 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.070731 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.070731 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:27:18.070731 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.073866 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:18.075110 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:27:18.076117 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:27:18.076117 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:27:18.076117 [info ] [Thread-1 (]: 29 of 47 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:18.077116 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:27:18.077116 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:27:18.077116 [info ] [Thread-1 (]: 30 of 47 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:27:18.078115 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:27:18.078663 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:27:18.079682 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:27:18.081489 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:27:18.084795 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:27:18.085318 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:27:18.085318 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:27:18.085318 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.086353 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.086353 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:27:18.086353 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:18.088464 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:18.089469 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:27:18.090999 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:27:18.090999 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:27:18.090999 [info ] [Thread-1 (]: 30 of 47 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m06:27:18.092014 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:27:18.092014 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:27:18.092014 [info ] [Thread-1 (]: 31 of 47 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:27:18.093229 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:27:18.093229 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:27:18.094767 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:27:18.096483 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:27:18.097019 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:27:18.099073 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:27:18.099073 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:27:18.099073 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.099608 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.099608 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:27:18.099608 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.100636 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.101820 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:27:18.101820 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:27:18.102848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:27:18.102848 [info ] [Thread-1 (]: 31 of 47 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:27:18.103831 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:27:18.103831 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:27:18.104362 [info ] [Thread-1 (]: 32 of 47 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:27:18.104362 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:27:18.104362 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:27:18.107415 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:27:18.107415 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:27:18.109945 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:27:18.110726 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:27:18.110726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:27:18.110726 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.111760 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.111760 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:27:18.111760 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.111760 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.113267 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:27:18.114288 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:27:18.114288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:27:18.115452 [info ] [Thread-1 (]: 32 of 47 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:27:18.115452 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:27:18.115452 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:27:18.115452 [info ] [Thread-1 (]: 33 of 47 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:18.116618 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:27:18.116921 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:27:18.119138 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:27:18.120833 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:27:18.122661 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:27:18.123860 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:27:18.123860 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:27:18.123860 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.124865 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.124865 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:27:18.125430 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.127975 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:18.127975 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:27:18.129481 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:27:18.130133 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:27:18.130558 [info ] [Thread-1 (]: 33 of 47 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:18.130558 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:27:18.130558 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:27:18.130558 [info ] [Thread-1 (]: 34 of 47 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:18.131562 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:27:18.131562 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:27:18.135554 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:27:18.136059 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:27:18.137564 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:27:18.138231 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:27:18.138231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:27:18.138231 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:18.139744 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:18.139744 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:27:18.139744 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:18.144846 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:27:18.144846 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:27:18.146569 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:27:18.146569 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:27:18.146569 [info ] [Thread-1 (]: 34 of 47 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:18.147675 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:27:18.147675 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:27:18.147675 [info ] [Thread-1 (]: 35 of 47 SKIP relation main.dim_consolidado .................................... [[33mSKIP[0m]
[0m06:27:18.148829 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:27:18.148829 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:27:18.148829 [info ] [Thread-1 (]: 36 of 47 SKIP relation main.dim_controle ....................................... [[33mSKIP[0m]
[0m06:27:18.149595 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:27:18.150004 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:27:18.150658 [info ] [Thread-1 (]: 37 of 47 SKIP relation main.dim_segmento ....................................... [[33mSKIP[0m]
[0m06:27:18.150658 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:27:18.151162 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_consolidado' to be skipped because of status 'skipped'. 
[0m06:27:18.151537 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_controle' to be skipped because of status 'skipped'. 
[0m06:27:18.152150 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:27:18.152150 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_segmento' to be skipped because of status 'skipped'. 
[0m06:27:18.152150 [info ] [Thread-1 (]: 38 of 47 SKIP test not_null_dim_consolidado_id_consolidado ..................... [[33mSKIP[0m]
[0m06:27:18.152150 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:27:18.153664 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:27:18.154174 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340' to be skipped because of status 'skipped'. 
[0m06:27:18.153664 [info ] [Thread-1 (]: 39 of 47 SKIP test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[33mSKIP[0m]
[0m06:27:18.154174 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:27:18.154174 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:27:18.155179 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e' to be skipped because of status 'skipped'. 
[0m06:27:18.155682 [info ] [Thread-1 (]: 40 of 47 SKIP test unique_dim_consolidado_id_consolidado ....................... [[33mSKIP[0m]
[0m06:27:18.155682 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:27:18.155682 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:27:18.156689 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862' to be skipped because of status 'skipped'. 
[0m06:27:18.156689 [info ] [Thread-1 (]: 41 of 47 SKIP test not_null_dim_controle_id_controle ........................... [[33mSKIP[0m]
[0m06:27:18.156689 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:27:18.157693 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:27:18.157693 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21' to be skipped because of status 'skipped'. 
[0m06:27:18.157693 [info ] [Thread-1 (]: 42 of 47 SKIP test not_null_dim_segmento_id_segmento ........................... [[33mSKIP[0m]
[0m06:27:18.158693 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:27:18.158693 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:27:18.158693 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e' to be skipped because of status 'skipped'. 
[0m06:27:18.159717 [info ] [Thread-1 (]: 43 of 47 SKIP test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[33mSKIP[0m]
[0m06:27:18.160220 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:27:18.160220 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:27:18.160767 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f' to be skipped because of status 'skipped'. 
[0m06:27:18.160767 [info ] [Thread-1 (]: 44 of 47 SKIP test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[33mSKIP[0m]
[0m06:27:18.160767 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:27:18.160767 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:27:18.161780 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e' to be skipped because of status 'skipped'. 
[0m06:27:18.161780 [info ] [Thread-1 (]: 45 of 47 SKIP test unique_dim_controle_id_controle ............................. [[33mSKIP[0m]
[0m06:27:18.161780 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:27:18.161780 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:27:18.161780 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c' to be skipped because of status 'skipped'. 
[0m06:27:18.163320 [info ] [Thread-1 (]: 46 of 47 SKIP test unique_dim_segmento_id_segmento ............................. [[33mSKIP[0m]
[0m06:27:18.163320 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:27:18.163833 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a' to be skipped because of status 'skipped'. 
[0m06:27:18.164343 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:27:18.164343 [info ] [Thread-1 (]: 47 of 47 SKIP relation main.view_resumo_financeiro_relatorios .................. [[33mSKIP[0m]
[0m06:27:18.164343 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:27:18.165347 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' to be skipped because of status 'skipped'. 
[0m06:27:18.166378 [debug] [MainThread]: Using duckdb connection "master"
[0m06:27:18.166378 [debug] [MainThread]: On master: BEGIN
[0m06:27:18.166915 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:27:18.166915 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:27:18.166915 [debug] [MainThread]: On master: COMMIT
[0m06:27:18.166915 [debug] [MainThread]: Using duckdb connection "master"
[0m06:27:18.166915 [debug] [MainThread]: On master: COMMIT
[0m06:27:18.167944 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:27:18.167944 [debug] [MainThread]: On master: Close
[0m06:27:18.167944 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:27:18.167944 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:27:18.168927 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:27:18.168927 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a' was properly closed.
[0m06:27:18.168927 [info ] [MainThread]: 
[0m06:27:18.168927 [info ] [MainThread]: Finished running 3 seeds, 7 table models, 36 data tests, 1 view model in 0 hours 0 minutes and 2.01 seconds (2.01s).
[0m06:27:18.172134 [debug] [MainThread]: Command end result
[0m06:27:18.254372 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:27:18.256383 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:27:18.261536 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:27:18.261536 [info ] [MainThread]: 
[0m06:27:18.263042 [info ] [MainThread]: [31mCompleted with 3 errors, 0 partial successes, and 0 warnings:[0m
[0m06:27:18.263042 [info ] [MainThread]: 
[0m06:27:18.263042 [error] [MainThread]: [31mFailure in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)[0m
[0m06:27:18.263042 [error] [MainThread]:   Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv"
[0m06:27:18.264047 [info ] [MainThread]: 
[0m06:27:18.264047 [error] [MainThread]: [31mFailure in seed seed_dim_controle (seeds\seed_dim_controle.csv)[0m
[0m06:27:18.264486 [error] [MainThread]:   Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv"
[0m06:27:18.264486 [info ] [MainThread]: 
[0m06:27:18.264990 [error] [MainThread]: [31mFailure in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)[0m
[0m06:27:18.264990 [error] [MainThread]:   Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv"
[0m06:27:18.264990 [info ] [MainThread]: 
[0m06:27:18.265587 [info ] [MainThread]: Done. PASS=31 WARN=0 ERROR=3 SKIP=13 NO-OP=0 TOTAL=47
[0m06:27:18.266182 [debug] [MainThread]: Command `dbt build` failed at 06:27:18.266182 after 3.21 seconds
[0m06:27:18.266823 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAD5B2FC0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAAAF6D50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020EAD077800>]}
[0m06:27:18.266823 [debug] [MainThread]: Flushing usage events
[0m06:27:19.057291 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:27:45.212048 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A645D70E0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A63E09310>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A60DD2BD0>]}


============================== 06:27:45.217221 | 0556f104-00ab-4ac9-9b3e-ea9f2725e13c ==============================
[0m06:27:45.217221 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:27:45.217728 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'src/bacen_ifdata/data_analytics', 'use_colors': 'True', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios --project-dir src/bacen_ifdata/data_analytics --profiles-dir src/bacen_ifdata/data_analytics', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:27:45.402629 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66071AF0>]}
[0m06:27:45.455790 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A660A25D0>]}
[0m06:27:45.458769 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:27:45.690098 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:27:45.843359 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
[0m06:27:45.843359 [debug] [MainThread]: Nothing changed, skipping partial parsing.
[0m06:27:45.843864 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing
[0m06:27:45.849737 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:27:45.886444 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A65F12960>]}
[0m06:27:45.964466 [debug] [MainThread]: Wrote artifact WritableManifest to src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:27:45.966884 [debug] [MainThread]: Wrote artifact SemanticManifest to src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:27:46.045000 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66538E90>]}
[0m06:27:46.045000 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:27:46.049353 [info ] [MainThread]: 
[0m06:27:46.050048 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:27:46.050048 [info ] [MainThread]: 
[0m06:27:46.050694 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:27:46.054038 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:27:46.115544 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:27:46.116056 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:27:46.116056 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:27:46.243324 [debug] [ThreadPool]: SQL status: OK in 0.127 seconds
[0m06:27:46.243870 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:27:46.244874 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:27:46.244874 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:27:46.249709 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:27:46.249709 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:27:46.249709 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:27:46.250717 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:27:46.251845 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:27:46.251845 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:27:46.251845 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:27:46.251845 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:27:46.252851 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:27:46.252851 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:27:46.252851 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:27:46.253852 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:27:46.253852 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:27:46.254357 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:27:46.254357 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:27:46.256479 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:27:46.260592 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:27:46.260592 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:27:46.261111 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:27:46.261111 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:27:46.261111 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:27:46.262120 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:27:46.271550 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m06:27:46.272065 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:27:46.273829 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:27:46.273829 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:27:46.277548 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A665EDA60>]}
[0m06:27:46.277548 [debug] [MainThread]: Using duckdb connection "master"
[0m06:27:46.277548 [debug] [MainThread]: On master: BEGIN
[0m06:27:46.277548 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:27:46.278572 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:27:46.278572 [debug] [MainThread]: On master: COMMIT
[0m06:27:46.279106 [debug] [MainThread]: Using duckdb connection "master"
[0m06:27:46.279106 [debug] [MainThread]: On master: COMMIT
[0m06:27:46.279106 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:27:46.279106 [debug] [MainThread]: On master: Close
[0m06:27:46.283290 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:27:46.283812 [info ] [Thread-1 (]: 1 of 47 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:27:46.283812 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:27:46.283812 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:27:46.297001 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.297001 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:27:46.318300 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.319301 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.319807 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:27:46.319807 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:27:46.319807 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:46.322817 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.322817 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN '1 - Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN '2 - Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN '3 - Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN '4 - Instituições com Operações de Câmbio'
            ELSE 'Outros'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:27:46.776187 [debug] [Thread-1 (]: SQL status: OK in 0.452 seconds
[0m06:27:46.779709 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.779709 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:27:46.781369 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.781921 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.781921 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:27:46.782950 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.786302 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.786302 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:27:46.787824 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.789510 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.789510 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:27:46.789510 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.801217 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:27:46.801217 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.801864 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:27:46.811684 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:27:46.816776 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:27:46.816776 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:27:46.817782 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:46.819288 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:27:46.821911 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A63F10440>]}
[0m06:27:46.821911 [info ] [Thread-1 (]: 1 of 47 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.54s]
[0m06:27:46.821911 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:27:46.823590 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:27:46.823590 [info ] [Thread-1 (]: 2 of 47 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:27:46.824679 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:27:46.824679 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:27:46.828327 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.828327 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:27:46.829829 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.831601 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.831601 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:27:46.831601 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:46.833271 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.833271 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.833271 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:27:46.905511 [debug] [Thread-1 (]: SQL status: OK in 0.072 seconds
[0m06:27:46.906540 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.906540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:27:46.907531 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.908515 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.908515 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:27:46.909514 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.911669 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.911669 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m06:27:46.911669 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.914735 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.914735 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:27:46.915257 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.915856 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:27:46.916451 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.916451 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:27:46.918082 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:46.919201 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:27:46.919201 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:27:46.920933 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:46.922452 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:27:46.922452 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66A03710>]}
[0m06:27:46.923457 [info ] [Thread-1 (]: 2 of 47 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.10s]
[0m06:27:46.923457 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:27:46.923457 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:27:46.923457 [info ] [Thread-1 (]: 3 of 47 START sql table model main.dim_tempo ................................... [RUN]
[0m06:27:46.923457 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:27:46.925045 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:27:46.931959 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.933471 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:27:46.936534 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.938013 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.938013 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:27:46.938013 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:46.938606 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.938606 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.939616 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:27:46.982862 [debug] [Thread-1 (]: SQL status: OK in 0.043 seconds
[0m06:27:46.983878 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.983878 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:27:46.984889 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.985396 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.985914 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:27:46.985914 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.988706 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.988706 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:27:46.989717 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.991224 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.992230 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:27:46.992733 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:46.993239 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:27:46.993239 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.993239 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:27:46.994846 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:46.996548 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:27:46.997665 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:27:46.998807 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:46.999352 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:27:47.000015 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66A01E50>]}
[0m06:27:47.000588 [info ] [Thread-1 (]: 3 of 47 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.08s]
[0m06:27:47.001205 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:27:47.001205 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:27:47.001719 [info ] [Thread-1 (]: 4 of 47 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m06:27:47.001719 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:27:47.002776 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:27:47.005565 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.006675 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:27:47.009591 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.010634 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.010634 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:27:47.010634 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.010634 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.010634 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.012170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:27:47.302706 [debug] [Thread-1 (]: SQL status: OK in 0.290 seconds
[0m06:27:47.303706 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.303706 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:27:47.304211 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.305722 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.305722 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:27:47.307728 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.310878 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.310878 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m06:27:47.311883 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.313387 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.314416 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:27:47.314416 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.316134 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:27:47.316678 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.316678 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:27:47.517103 [debug] [Thread-1 (]: SQL status: OK in 0.201 seconds
[0m06:27:47.519266 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:27:47.520908 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:27:47.521926 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:47.523584 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:27:47.524618 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66A02B70>]}
[0m06:27:47.524618 [info ] [Thread-1 (]: 4 of 47 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.52s]
[0m06:27:47.524618 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:27:47.525724 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:27:47.525724 [info ] [Thread-1 (]: 5 of 47 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m06:27:47.525724 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:27:47.526969 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:27:47.526969 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:27:47.544659 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:27:47.544659 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:27:47.546396 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.546946 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.546946 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:27:47.546946 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m06:27:47.546946 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.553871 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:27:47.555430 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:27:47.569405 [debug] [Thread-1 (]: SQL status: OK in 0.014 seconds
[0m06:27:47.575131 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:27:47.576641 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:27:47.577648 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:27:47.577648 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:27:47.579749 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:47.579749 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:27:47.579749 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66B90C50>]}
[0m06:27:47.581343 [info ] [Thread-1 (]: 5 of 47 OK loaded seed file main.seed_dim_consolidado .......................... [[32mINSERT 8[0m in 0.05s]
[0m06:27:47.581936 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:27:47.581936 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:27:47.582941 [info ] [Thread-1 (]: 6 of 47 START seed file main.seed_dim_controle ................................. [RUN]
[0m06:27:47.582941 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:27:47.583445 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:27:47.583445 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:27:47.587492 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:27:47.587997 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:27:47.587997 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.588612 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.588612 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:27:47.589617 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m06:27:47.589617 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.589617 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:27:47.591123 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:27:47.592634 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.593140 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:27:47.594654 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:27:47.594654 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:27:47.594654 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:27:47.597179 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.597719 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:27:47.598224 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66A82630>]}
[0m06:27:47.598737 [info ] [Thread-1 (]: 6 of 47 OK loaded seed file main.seed_dim_controle ............................. [[32mINSERT 3[0m in 0.02s]
[0m06:27:47.598737 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:27:47.599473 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:27:47.599473 [info ] [Thread-1 (]: 7 of 47 START seed file main.seed_dim_segmento ................................. [RUN]
[0m06:27:47.599473 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:27:47.599473 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:27:47.599473 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:27:47.605547 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:27:47.605547 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:27:47.606564 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.606564 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.606564 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:27:47.607581 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m06:27:47.607581 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.608563 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:27:47.608563 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:27:47.610594 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.610594 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:27:47.613137 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:27:47.613137 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:27:47.613735 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:27:47.615265 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.615833 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:27:47.615833 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66BABA70>]}
[0m06:27:47.616496 [info ] [Thread-1 (]: 7 of 47 OK loaded seed file main.seed_dim_segmento ............................. [[32mINSERT 5[0m in 0.02s]
[0m06:27:47.617083 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:27:47.617083 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:27:47.617083 [info ] [Thread-1 (]: 8 of 47 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:27:47.618088 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:27:47.618088 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:27:47.626252 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:27:47.627252 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:27:47.639699 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:27:47.641204 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:27:47.641204 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:27:47.642262 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.642262 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.642262 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:27:47.643406 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.644427 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.646726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:27:47.647295 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:27:47.647295 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:27:47.647295 [info ] [Thread-1 (]: 8 of 47 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m06:27:47.647295 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:27:47.648822 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:27:47.649402 [info ] [Thread-1 (]: 9 of 47 START test not_null_dim_instituicao_id_localizacao ..................... [RUN]
[0m06:27:47.649402 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:27:47.649402 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:27:47.652534 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:27:47.653534 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:27:47.655546 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:27:47.655546 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:27:47.656553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:27:47.656553 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.656553 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.657551 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:27:47.657551 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.658550 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.658550 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:27:47.661040 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:27:47.661040 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:27:47.661040 [info ] [Thread-1 (]: 9 of 47 PASS not_null_dim_instituicao_id_localizacao ........................... [[32mPASS[0m in 0.01s]
[0m06:27:47.662055 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:27:47.662055 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:27:47.662055 [info ] [Thread-1 (]: 10 of 47 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:27:47.663056 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:27:47.663056 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:27:47.669176 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:27:47.670756 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:27:47.673275 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:27:47.674280 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:27:47.674784 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:27:47.675340 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.675340 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.676349 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:27:47.677346 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.680903 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:27:47.681945 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:27:47.683557 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:27:47.683557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:27:47.684164 [info ] [Thread-1 (]: 10 of 47 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:47.684929 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:27:47.684929 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:27:47.685525 [info ] [Thread-1 (]: 11 of 47 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:47.685525 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:27:47.685525 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:27:47.690883 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:27:47.693415 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:27:47.694995 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:27:47.697290 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:27:47.698903 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:27:47.699657 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.701177 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.701823 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:27:47.702831 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.719361 [debug] [Thread-1 (]: SQL status: OK in 0.016 seconds
[0m06:27:47.724280 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:27:47.726066 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:27:47.727095 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:27:47.728088 [info ] [Thread-1 (]: 11 of 47 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m06:27:47.729076 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:27:47.730204 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:27:47.731213 [info ] [Thread-1 (]: 12 of 47 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:47.731818 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:27:47.731818 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:27:47.739470 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:27:47.740994 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:27:47.743625 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:27:47.743625 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:27:47.744639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:27:47.744639 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.744639 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.744639 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:27:47.744639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.751208 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:27:47.751739 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:27:47.752749 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:27:47.752749 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:27:47.753749 [info ] [Thread-1 (]: 12 of 47 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:47.754260 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:27:47.754260 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:27:47.755261 [info ] [Thread-1 (]: 13 of 47 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:47.755261 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:27:47.755764 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:27:47.760546 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:27:47.760546 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:27:47.763065 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:27:47.763065 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:27:47.763065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:27:47.763065 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.764808 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.764808 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:27:47.765404 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.768944 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:27:47.770379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:27:47.770899 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:27:47.770899 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:27:47.770899 [info ] [Thread-1 (]: 13 of 47 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:47.771930 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:27:47.772463 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:27:47.772463 [info ] [Thread-1 (]: 14 of 47 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:47.772463 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:27:47.773476 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:27:47.777133 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:27:47.778145 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:27:47.779648 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:27:47.781408 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:27:47.781408 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:27:47.782019 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.782019 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.782019 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:27:47.783025 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.786386 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:27:47.787888 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:27:47.788492 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:27:47.788492 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:27:47.789520 [info ] [Thread-1 (]: 14 of 47 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:47.789520 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:27:47.789520 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:27:47.789520 [info ] [Thread-1 (]: 15 of 47 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:47.791026 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:27:47.791026 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:27:47.794593 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:27:47.794593 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:27:47.796951 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:27:47.796951 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:27:47.798665 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:27:47.798665 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.799337 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.799337 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:27:47.800010 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.805881 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:27:47.806992 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:27:47.806992 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:27:47.807994 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:27:47.807994 [info ] [Thread-1 (]: 15 of 47 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:47.808934 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:27:47.808934 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:27:47.808934 [info ] [Thread-1 (]: 16 of 47 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:47.808934 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:27:47.810073 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:27:47.813277 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:27:47.813277 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:27:47.815718 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:27:47.816437 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:27:47.817073 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:27:47.817073 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.817073 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.818077 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:27:47.818077 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.819217 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:47.820848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:27:47.820848 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:27:47.820848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:27:47.822745 [info ] [Thread-1 (]: 16 of 47 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:27:47.822745 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:27:47.823450 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:27:47.823450 [info ] [Thread-1 (]: 17 of 47 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:47.823450 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:27:47.823450 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:27:47.827403 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:27:47.828389 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:27:47.830887 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:27:47.831999 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:27:47.831999 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:27:47.831999 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.833004 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.833510 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:27:47.833510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.837638 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:27:47.839211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:27:47.840213 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:27:47.840213 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:27:47.841210 [info ] [Thread-1 (]: 17 of 47 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:47.841210 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:27:47.841715 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:27:47.842296 [info ] [Thread-1 (]: 18 of 47 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:27:47.842296 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:27:47.842296 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:27:47.849319 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:27:47.850140 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:27:47.851653 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:27:47.852659 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:27:47.852659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:27:47.852659 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.854165 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.854165 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:27:47.854165 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:47.858228 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:27:47.859734 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:27:47.860554 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:27:47.860554 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:27:47.861560 [info ] [Thread-1 (]: 18 of 47 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:27:47.861560 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:27:47.861560 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:27:47.861560 [info ] [Thread-1 (]: 19 of 47 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:27:47.863065 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:27:47.863065 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:27:47.866429 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:27:47.867230 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:27:47.868279 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:27:47.869723 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:27:47.869723 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:27:47.869723 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.869723 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.871274 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:27:47.871274 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.871892 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.873412 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:27:47.874528 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:27:47.874528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:27:47.875126 [info ] [Thread-1 (]: 19 of 47 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:27:47.876139 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:27:47.876139 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:27:47.877139 [info ] [Thread-1 (]: 20 of 47 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:27:47.877139 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:27:47.878140 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:27:47.883264 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:27:47.883955 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:27:47.885683 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:27:47.886695 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:27:47.886695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:27:47.886695 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.887695 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.888198 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:27:47.888198 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.890228 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.890758 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:27:47.890758 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:27:47.892491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:27:47.892491 [info ] [Thread-1 (]: 20 of 47 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m06:27:47.893496 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:27:47.893496 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:27:47.894038 [info ] [Thread-1 (]: 21 of 47 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:27:47.894038 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:27:47.894038 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:27:47.897574 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:27:47.897574 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:27:47.899939 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:27:47.900950 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:27:47.900950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:27:47.901454 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.901454 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.901454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:27:47.901454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:47.903976 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:47.904479 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:27:47.905803 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:27:47.905803 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:27:47.906487 [info ] [Thread-1 (]: 21 of 47 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.01s]
[0m06:27:47.906487 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:27:47.906487 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:27:47.907532 [info ] [Thread-1 (]: 22 of 47 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:27:47.908488 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:27:47.908488 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:27:47.911716 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:27:47.911716 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:27:47.915656 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:27:47.915656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:27:47.916662 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:27:47.916662 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.917281 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.917281 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:27:47.917886 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.917886 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.918993 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:27:47.920267 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:27:47.920267 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:27:47.920867 [info ] [Thread-1 (]: 22 of 47 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m06:27:47.920867 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:27:47.920867 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:27:47.921931 [info ] [Thread-1 (]: 23 of 47 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:47.921931 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:27:47.921931 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:27:47.926515 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:27:47.927497 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:27:47.928520 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:27:47.929514 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:27:47.929514 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:27:47.930312 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.930878 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.930878 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:27:47.930878 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.935272 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:27:47.936284 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:27:47.937790 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:27:47.938590 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:27:47.938590 [info ] [Thread-1 (]: 23 of 47 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:27:47.939595 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:27:47.939595 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:27:47.939595 [info ] [Thread-1 (]: 24 of 47 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:47.939595 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:27:47.939595 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:27:47.944718 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:27:47.944718 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:27:47.947183 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:27:47.948745 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:27:47.948745 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:27:47.949383 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.949383 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.949383 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:27:47.949383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.953582 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:27:47.954088 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:27:47.958706 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:27:47.960212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:27:47.960804 [info ] [Thread-1 (]: 24 of 47 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:27:47.961810 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:27:47.961810 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:27:47.963354 [info ] [Thread-1 (]: 25 of 47 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:47.963354 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:27:47.963354 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:27:47.967994 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:27:47.968884 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:27:47.970897 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:27:47.971915 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:27:47.972419 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:27:47.972419 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.972419 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.972419 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:27:47.973556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.975704 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:47.976319 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:27:47.977445 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:27:47.977445 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:27:47.977445 [info ] [Thread-1 (]: 25 of 47 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:47.978365 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:27:47.978365 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:27:47.978365 [info ] [Thread-1 (]: 26 of 47 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:47.979374 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:27:47.979374 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:27:47.983195 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:27:47.983772 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:27:47.985304 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:27:47.986310 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:27:47.986310 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:27:47.986310 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:47.987816 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:47.987816 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:27:47.988355 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:47.990360 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:47.991371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:27:47.992377 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:27:47.992377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:27:47.992881 [info ] [Thread-1 (]: 26 of 47 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:47.993385 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:27:47.993385 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:27:47.993385 [info ] [Thread-1 (]: 27 of 47 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:47.993385 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:27:47.993385 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:27:47.999498 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:27:48.000117 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:27:48.001864 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:27:48.002983 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:27:48.002983 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:27:48.002983 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.003981 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.003981 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:27:48.003981 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.007674 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:27:48.008678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:27:48.009676 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:27:48.010181 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:27:48.010181 [info ] [Thread-1 (]: 27 of 47 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:27:48.010693 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:27:48.010693 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:27:48.011699 [info ] [Thread-1 (]: 28 of 47 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:48.011699 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:27:48.011699 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:27:48.016948 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:27:48.017464 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:27:48.019090 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:27:48.020096 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:27:48.020096 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:27:48.020096 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.021208 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.021208 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:27:48.021208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.022779 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.024444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:27:48.024444 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:27:48.025296 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:27:48.025296 [info ] [Thread-1 (]: 28 of 47 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:48.025296 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:27:48.026316 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:27:48.026316 [info ] [Thread-1 (]: 29 of 47 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:48.027300 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:27:48.027300 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:27:48.029913 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:27:48.029913 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:27:48.032386 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:27:48.034065 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:27:48.034065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:27:48.034712 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.034712 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.035312 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:27:48.035312 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.036333 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:48.038488 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:27:48.039517 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:27:48.039517 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:27:48.039517 [info ] [Thread-1 (]: 29 of 47 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:48.039517 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:27:48.039517 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:27:48.041021 [info ] [Thread-1 (]: 30 of 47 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:27:48.041021 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:27:48.041021 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:27:48.044282 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:27:48.044788 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:27:48.046553 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:27:48.047219 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:27:48.047219 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:27:48.047219 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.047219 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.047219 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:27:48.047219 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:48.048973 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.050455 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:27:48.051234 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:27:48.051974 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:27:48.051974 [info ] [Thread-1 (]: 30 of 47 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m06:27:48.051974 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:27:48.052986 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:27:48.052986 [info ] [Thread-1 (]: 31 of 47 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:27:48.052986 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:27:48.052986 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:27:48.056642 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:27:48.056642 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:27:48.060299 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:27:48.060926 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:27:48.060926 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:27:48.060926 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.061956 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.061956 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:27:48.061956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.062949 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.062949 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:27:48.064599 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:27:48.064599 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:27:48.065614 [info ] [Thread-1 (]: 31 of 47 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:27:48.066122 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:27:48.066683 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:27:48.066940 [info ] [Thread-1 (]: 32 of 47 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:27:48.066940 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:27:48.066940 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:27:48.069956 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:27:48.070962 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:27:48.071973 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:27:48.071973 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:27:48.073546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:27:48.073546 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.073546 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.074553 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:27:48.074553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.075058 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.076065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:27:48.077064 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:27:48.077064 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:27:48.077064 [info ] [Thread-1 (]: 32 of 47 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:27:48.078064 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:27:48.078064 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:27:48.078064 [info ] [Thread-1 (]: 33 of 47 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:27:48.079064 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:27:48.079064 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:27:48.083095 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:27:48.083601 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:27:48.085668 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:27:48.086674 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:27:48.086674 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:27:48.086674 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.087758 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.087758 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:27:48.087758 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.090640 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:27:48.091255 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:27:48.092381 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:27:48.092381 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:27:48.092381 [info ] [Thread-1 (]: 33 of 47 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:27:48.093533 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:27:48.093533 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:27:48.094159 [info ] [Thread-1 (]: 34 of 47 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:27:48.094664 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:27:48.094664 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:27:48.097307 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:27:48.099399 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:27:48.101022 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:27:48.101629 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:27:48.101629 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:27:48.101629 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.102742 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.102742 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:27:48.102742 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.110174 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:27:48.110873 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:27:48.111879 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:27:48.111879 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:27:48.111879 [info ] [Thread-1 (]: 34 of 47 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:27:48.113384 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:27:48.113384 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:27:48.113384 [info ] [Thread-1 (]: 35 of 47 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:27:48.114390 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:27:48.114390 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:27:48.116909 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.119476 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:27:48.120997 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.122942 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.123462 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:27:48.123462 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.123462 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.123462 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.124511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:27:48.125326 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.125326 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.126349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m06:27:48.126349 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.127441 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.127441 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m06:27:48.128378 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.132214 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.132214 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m06:27:48.132214 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.134793 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.134793 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:27:48.135437 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.135437 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:27:48.136457 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.136457 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:27:48.137943 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.139508 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:27:48.139508 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:27:48.139508 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.141016 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:27:48.141016 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A7F78B5F0>]}
[0m06:27:48.141016 [info ] [Thread-1 (]: 35 of 47 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:27:48.143280 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:27:48.143280 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:27:48.143827 [info ] [Thread-1 (]: 36 of 47 START sql table model main.dim_controle ............................... [RUN]
[0m06:27:48.143827 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:27:48.144828 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:27:48.146965 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.146965 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:27:48.150104 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.151241 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.151241 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:27:48.151844 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.152349 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.152349 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.152349 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:27:48.153356 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.153861 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.153861 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m06:27:48.154867 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.155372 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.155372 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m06:27:48.156378 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.158379 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.158379 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m06:27:48.159885 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.161499 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.161499 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:27:48.161499 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.163005 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:27:48.163005 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.163005 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:27:48.165179 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.167163 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:27:48.167163 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:27:48.167163 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.168703 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:27:48.169393 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A66B86F60>]}
[0m06:27:48.169393 [info ] [Thread-1 (]: 36 of 47 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m06:27:48.169393 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:27:48.169393 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:27:48.171039 [info ] [Thread-1 (]: 37 of 47 START sql table model main.dim_segmento ............................... [RUN]
[0m06:27:48.171039 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:27:48.171039 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:27:48.173052 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.174662 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:27:48.177669 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.179689 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.180318 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:27:48.180318 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.180896 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.180896 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.180896 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:27:48.182429 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.182955 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.182955 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m06:27:48.184134 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.184713 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.184713 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m06:27:48.185864 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.188324 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.188324 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m06:27:48.188324 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.190998 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.190998 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:27:48.190998 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.192081 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:27:48.192081 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.192081 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:27:48.193759 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.196048 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:27:48.196048 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:27:48.197229 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.197229 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:27:48.197229 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A7F7EBBC0>]}
[0m06:27:48.198857 [info ] [Thread-1 (]: 37 of 47 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m06:27:48.199443 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:27:48.199443 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:27:48.199443 [info ] [Thread-1 (]: 38 of 47 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:27:48.199443 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:27:48.199443 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:27:48.202884 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:27:48.203858 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:27:48.205420 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:27:48.206437 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:27:48.206437 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:27:48.207440 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.207440 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.207440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:27:48.207440 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.208460 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.209984 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:27:48.210839 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:27:48.210839 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:27:48.211171 [info ] [Thread-1 (]: 38 of 47 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:27:48.211850 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:27:48.211850 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:27:48.211850 [info ] [Thread-1 (]: 39 of 47 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:27:48.211850 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:27:48.211850 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:27:48.217040 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:27:48.217040 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:27:48.219128 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:27:48.219128 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:27:48.219128 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:27:48.220717 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.220717 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.220717 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:27:48.220717 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.222459 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.224476 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:27:48.225190 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:27:48.225190 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:27:48.225190 [info ] [Thread-1 (]: 39 of 47 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m06:27:48.226196 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:27:48.226196 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:27:48.226196 [info ] [Thread-1 (]: 40 of 47 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:27:48.226196 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:27:48.227239 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:27:48.229927 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:27:48.229927 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:27:48.232355 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:27:48.233995 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:27:48.233995 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:27:48.233995 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.234519 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.234519 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:27:48.234519 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:48.236051 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.238368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:27:48.239374 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:27:48.239374 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:27:48.240380 [info ] [Thread-1 (]: 40 of 47 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:27:48.240380 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:27:48.240380 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:27:48.241379 [info ] [Thread-1 (]: 41 of 47 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:27:48.241379 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:27:48.241884 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:27:48.243899 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:27:48.244904 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:27:48.246986 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:27:48.247506 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:27:48.247506 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:27:48.247506 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.248739 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.248739 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:27:48.248739 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.249424 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.249424 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:27:48.251797 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:27:48.251797 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:27:48.251797 [info ] [Thread-1 (]: 41 of 47 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:27:48.252803 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:27:48.252803 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:27:48.252803 [info ] [Thread-1 (]: 42 of 47 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:27:48.253802 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:27:48.253802 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:27:48.257819 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:27:48.257819 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:27:48.260324 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:27:48.260977 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:27:48.260977 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:27:48.260977 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.261983 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.261983 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:27:48.262488 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.262993 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.264741 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:27:48.265748 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:27:48.265748 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:27:48.266253 [info ] [Thread-1 (]: 42 of 47 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m06:27:48.266253 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:27:48.267258 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:27:48.267258 [info ] [Thread-1 (]: 43 of 47 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:27:48.267258 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:27:48.267258 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:27:48.271944 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:27:48.272450 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:27:48.274473 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:27:48.275247 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:27:48.275247 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:27:48.275247 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.275247 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.276778 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:27:48.276778 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:48.277808 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.279317 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:27:48.279970 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:27:48.280364 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:27:48.280364 [info ] [Thread-1 (]: 43 of 47 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:27:48.280364 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:27:48.281370 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:27:48.281370 [info ] [Thread-1 (]: 44 of 47 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:27:48.282108 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:27:48.282108 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:27:48.285407 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:27:48.285995 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:27:48.287824 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:27:48.288643 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:27:48.288643 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:27:48.288643 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.289648 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.289648 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:27:48.289648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.289648 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.291668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:27:48.292182 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:27:48.292182 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:27:48.292182 [info ] [Thread-1 (]: 44 of 47 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:27:48.292182 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:27:48.293982 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:27:48.293982 [info ] [Thread-1 (]: 45 of 47 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:27:48.293982 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:27:48.293982 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:27:48.298917 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:27:48.299599 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:27:48.301762 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:27:48.302767 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:27:48.302767 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:27:48.303768 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.304273 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.304273 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:27:48.304273 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:27:48.305956 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.306979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:27:48.308123 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:27:48.308123 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:27:48.308123 [info ] [Thread-1 (]: 45 of 47 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.01s]
[0m06:27:48.308123 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:27:48.308123 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:27:48.309738 [info ] [Thread-1 (]: 46 of 47 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:27:48.310281 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:27:48.310281 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:27:48.313162 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:27:48.313162 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:27:48.315398 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:27:48.317607 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:27:48.317607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:27:48.317607 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.318609 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.318609 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:27:48.318609 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:27:48.319942 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.321451 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:27:48.322488 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:27:48.322488 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:27:48.323029 [info ] [Thread-1 (]: 46 of 47 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m06:27:48.323029 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:27:48.324569 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:27:48.324569 [info ] [Thread-1 (]: 47 of 47 START sql view model main.view_resumo_financeiro_relatorios ........... [RUN]
[0m06:27:48.325171 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios)
[0m06:27:48.325171 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:27:48.330226 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:27:48.331044 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:27:48.343302 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:27:48.343302 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:27:48.345018 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: BEGIN
[0m06:27:48.345018 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:27:48.345018 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.346027 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:27:48.346027 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    
    -- Data
    t.data as data_base,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
  );

[0m06:27:48.347162 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.349430 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:27:48.349430 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */
alter view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" rename to "view_resumo_financeiro_relatorios"
[0m06:27:48.351199 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.352167 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m06:27:48.352167 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:27:48.352868 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m06:27:48.354371 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:27:48.356399 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:27:48.356399 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_backup" cascade
    
[0m06:27:48.357379 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:27:48.357379 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: Close
[0m06:27:48.358394 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0556f104-00ab-4ac9-9b3e-ea9f2725e13c', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A7F7B92E0>]}
[0m06:27:48.358394 [info ] [Thread-1 (]: 47 of 47 OK created sql view model main.view_resumo_financeiro_relatorios ...... [[32mOK[0m in 0.03s]
[0m06:27:48.358394 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:27:48.360659 [debug] [MainThread]: Using duckdb connection "master"
[0m06:27:48.360659 [debug] [MainThread]: On master: BEGIN
[0m06:27:48.360659 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:27:48.361666 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:27:48.361666 [debug] [MainThread]: On master: COMMIT
[0m06:27:48.361666 [debug] [MainThread]: Using duckdb connection "master"
[0m06:27:48.361666 [debug] [MainThread]: On master: COMMIT
[0m06:27:48.363185 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:27:48.363185 [debug] [MainThread]: On master: Close
[0m06:27:48.363185 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:27:48.363185 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:27:48.363185 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:27:48.363185 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' was properly closed.
[0m06:27:48.364216 [info ] [MainThread]: 
[0m06:27:48.364216 [info ] [MainThread]: Finished running 3 seeds, 7 table models, 36 data tests, 1 view model in 0 hours 0 minutes and 2.31 seconds (2.31s).
[0m06:27:48.367655 [debug] [MainThread]: Command end result
[0m06:27:48.402877 [debug] [MainThread]: Wrote artifact WritableManifest to src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:27:48.405884 [debug] [MainThread]: Wrote artifact SemanticManifest to src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:27:48.413535 [debug] [MainThread]: Wrote artifact RunExecutionResult to src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:27:48.414041 [info ] [MainThread]: 
[0m06:27:48.414545 [info ] [MainThread]: [32mCompleted successfully[0m
[0m06:27:48.414545 [info ] [MainThread]: 
[0m06:27:48.414545 [info ] [MainThread]: Done. PASS=47 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=47
[0m06:27:48.416058 [debug] [MainThread]: Command `dbt build` succeeded at 06:27:48.415555 after 3.33 seconds
[0m06:27:48.416058 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A64A965A0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A64A96000>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021A64A96480>]}
[0m06:27:48.416563 [debug] [MainThread]: Flushing usage events
[0m06:27:49.515786 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:31:28.008581 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002039F0B4740>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002039F0B6CC0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002039EC69C40>]}


============================== 06:31:28.015212 | 585f8622-2d3b-41e6-81f1-78dc9ddc53b0 ==============================
[0m06:31:28.015212 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:31:28.015756 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios', 'use_colors': 'True', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:31:28.195029 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A07680B0>]}
[0m06:31:28.240216 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002039EE0E300>]}
[0m06:31:28.242284 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:31:28.448895 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:31:28.571182 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed.
[0m06:31:28.571182 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m06:31:28.572190 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_capital_prudencial.sql
[0m06:31:28.572695 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m06:31:28.572695 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m06:31:28.573199 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m06:31:28.573199 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m06:31:28.573199 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m06:31:28.573199 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m06:31:28.573199 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\dim_instituicao.sql
[0m06:31:28.931849 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:31:28.931849 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A0DD7F20>]}
[0m06:31:29.069037 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:31:29.079905 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A0D8E720>]}
[0m06:31:29.156538 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:31:29.159174 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:31:29.201501 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A0B70C80>]}
[0m06:31:29.201501 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:31:29.205817 [info ] [MainThread]: 
[0m06:31:29.205817 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:31:29.205817 [info ] [MainThread]: 
[0m06:31:29.206830 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:31:29.209911 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:31:29.275169 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:31:29.275169 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:31:29.276199 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:31:29.416425 [debug] [ThreadPool]: SQL status: OK in 0.141 seconds
[0m06:31:29.417006 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:31:29.418017 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:31:29.418017 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:31:29.421934 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:31:29.423701 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:31:29.423701 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:31:29.423701 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:31:29.425285 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:31:29.425285 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:31:29.425285 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:31:29.426297 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:31:29.426297 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:31:29.426297 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:31:29.427312 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:31:29.427312 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:31:29.427312 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:31:29.427312 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:31:29.428309 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:31:29.429802 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:31:29.434343 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:31:29.434343 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:31:29.434995 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:31:29.435528 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:31:29.435528 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:31:29.435528 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:31:29.446576 [debug] [ThreadPool]: SQL status: OK in 0.011 seconds
[0m06:31:29.447291 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:31:29.447291 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:31:29.448905 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:31:29.451863 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002039C0D6C90>]}
[0m06:31:29.451863 [debug] [MainThread]: Using duckdb connection "master"
[0m06:31:29.452876 [debug] [MainThread]: On master: BEGIN
[0m06:31:29.452876 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:31:29.452876 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:31:29.452876 [debug] [MainThread]: On master: COMMIT
[0m06:31:29.453876 [debug] [MainThread]: Using duckdb connection "master"
[0m06:31:29.453876 [debug] [MainThread]: On master: COMMIT
[0m06:31:29.454380 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:31:29.454380 [debug] [MainThread]: On master: Close
[0m06:31:29.457724 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:31:29.457724 [info ] [Thread-1 (]: 1 of 47 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:31:29.458765 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:31:29.458765 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:31:29.471956 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.471956 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:31:29.493064 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.493064 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.494580 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:31:29.494580 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:31:29.494580 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:29.494580 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.496227 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
            ELSE 'Outros'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:31:29.961797 [debug] [Thread-1 (]: SQL status: OK in 0.465 seconds
[0m06:31:29.966242 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.966242 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:31:29.966826 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:29.967857 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.967857 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:31:29.968853 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:29.973051 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.973051 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:31:29.973581 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:29.975634 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.976168 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:31:29.976168 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:29.986327 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:31:29.986327 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:29.987327 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:31:29.998513 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:31:30.002861 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:30.002861 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:31:30.004041 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.005581 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:31:30.007611 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A0DC24E0>]}
[0m06:31:30.008593 [info ] [Thread-1 (]: 1 of 47 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.55s]
[0m06:31:30.008593 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:31:30.009588 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:31:30.010091 [info ] [Thread-1 (]: 2 of 47 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:31:30.010601 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:31:30.011166 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:31:30.013239 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.014463 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:31:30.017154 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.017154 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.018165 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:31:30.018165 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.018675 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.018675 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.019370 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:31:30.061619 [debug] [Thread-1 (]: SQL status: OK in 0.043 seconds
[0m06:31:30.063125 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.064131 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:31:30.064635 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.066286 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.066286 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:31:30.066865 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.069385 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.069385 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m06:31:30.069385 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.072422 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.072422 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:31:30.073428 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.074438 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:31:30.074438 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.074438 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:31:30.076954 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:30.077977 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:30.079509 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:31:30.080078 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.081653 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:31:30.081653 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A139D640>]}
[0m06:31:30.081653 [info ] [Thread-1 (]: 2 of 47 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.07s]
[0m06:31:30.081653 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:31:30.083314 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:31:30.083314 [info ] [Thread-1 (]: 3 of 47 START sql table model main.dim_tempo ................................... [RUN]
[0m06:31:30.083980 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:31:30.084596 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:31:30.091931 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.093540 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:31:30.098777 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.099900 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.099900 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:31:30.099900 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.100910 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.101420 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.102429 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:31:30.148895 [debug] [Thread-1 (]: SQL status: OK in 0.046 seconds
[0m06:31:30.149513 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.150543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:31:30.151581 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.152096 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.152096 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:31:30.153609 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.155613 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.155613 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:31:30.155613 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.158138 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.159642 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:31:30.160186 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.160710 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:31:30.161715 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.161715 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:31:30.164231 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:30.167199 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:30.167199 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:31:30.167199 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.169386 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:31:30.169386 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A1506C90>]}
[0m06:31:30.169386 [info ] [Thread-1 (]: 3 of 47 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.09s]
[0m06:31:30.169386 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:31:30.170987 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:31:30.170987 [info ] [Thread-1 (]: 4 of 47 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m06:31:30.170987 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:31:30.171990 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:31:30.175142 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.175142 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:31:30.177709 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.179252 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.179252 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:31:30.179810 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.179810 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.179810 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.180830 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:31:30.432048 [debug] [Thread-1 (]: SQL status: OK in 0.252 seconds
[0m06:31:30.433558 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.433558 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:31:30.434297 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.435762 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.435762 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:31:30.436774 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.438584 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.438584 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m06:31:30.439619 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.441142 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.441766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:31:30.442382 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.442382 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:31:30.443493 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.443493 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:31:30.617716 [debug] [Thread-1 (]: SQL status: OK in 0.174 seconds
[0m06:31:30.619222 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:30.619222 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:31:30.620831 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.622523 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:31:30.623564 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A139EF60>]}
[0m06:31:30.623564 [info ] [Thread-1 (]: 4 of 47 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.45s]
[0m06:31:30.624717 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:31:30.624717 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:31:30.625243 [info ] [Thread-1 (]: 5 of 47 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m06:31:30.625243 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:31:30.625243 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:31:30.626274 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:31:30.643780 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:31:30.644785 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:31:30.644785 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.644785 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.645791 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:31:30.645791 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m06:31:30.646295 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.652852 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:31:30.653850 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:31:30.654915 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:31:30.654915 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:31:30.655436 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: ROLLBACK
[0m06:31:30.659009 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_consolidado'
[0m06:31:30.659009 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:31:30.661076 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv"
[0m06:31:30.661076 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203C1F13800>]}
[0m06:31:30.662108 [error] [Thread-1 (]: 5 of 47 ERROR loading seed file main.seed_dim_consolidado ...................... [[31mERROR[0m in 0.04s]
[0m06:31:30.662108 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:31:30.663103 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:31:30.663103 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_consolidado' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv".
[0m06:31:30.663103 [info ] [Thread-1 (]: 6 of 47 START seed file main.seed_dim_controle ................................. [RUN]
[0m06:31:30.664734 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:31:30.664734 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:31:30.664734 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:31:30.671058 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:31:30.672069 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:31:30.672069 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.672069 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.673762 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:31:30.673762 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m06:31:30.673762 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.675231 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:31:30.676237 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:31:30.676741 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:31:30.676741 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:31:30.677748 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: ROLLBACK
[0m06:31:30.679849 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_controle'
[0m06:31:30.680854 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:31:30.683405 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv"
[0m06:31:30.683405 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A146D6D0>]}
[0m06:31:30.683405 [error] [Thread-1 (]: 6 of 47 ERROR loading seed file main.seed_dim_controle ......................... [[31mERROR[0m in 0.02s]
[0m06:31:30.684625 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:31:30.684625 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:31:30.685632 [info ] [Thread-1 (]: 7 of 47 START seed file main.seed_dim_segmento ................................. [RUN]
[0m06:31:30.685632 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:31:30.686136 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_controle' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv".
[0m06:31:30.686136 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:31:30.687141 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:31:30.690291 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:31:30.691289 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:31:30.691289 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.691795 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.692300 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:31:30.692300 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m06:31:30.692300 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.693811 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:31:30.693811 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:31:30.694816 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:31:30.694816 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:31:30.694816 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: ROLLBACK
[0m06:31:30.697989 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_segmento'
[0m06:31:30.699023 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:31:30.702925 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv"
[0m06:31:30.702925 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '585f8622-2d3b-41e6-81f1-78dc9ddc53b0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000203A15097C0>]}
[0m06:31:30.703947 [error] [Thread-1 (]: 7 of 47 ERROR loading seed file main.seed_dim_segmento ......................... [[31mERROR[0m in 0.02s]
[0m06:31:30.703947 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:31:30.703947 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:31:30.705638 [info ] [Thread-1 (]: 8 of 47 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:31:30.705638 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_segmento' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv".
[0m06:31:30.706652 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:31:30.706652 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:31:30.713179 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:31:30.714866 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:31:30.727571 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:31:30.727571 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:31:30.727571 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:31:30.729078 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.730086 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.730591 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:31:30.731096 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.732102 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.735287 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:31:30.736294 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:31:30.736294 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:31:30.736294 [info ] [Thread-1 (]: 8 of 47 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m06:31:30.737799 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:31:30.738373 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:31:30.738373 [info ] [Thread-1 (]: 9 of 47 START test not_null_dim_instituicao_id_localizacao ..................... [RUN]
[0m06:31:30.738373 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:31:30.739377 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:31:30.743543 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:31:30.744549 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:31:30.747086 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:31:30.747086 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:31:30.747086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:31:30.747086 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.749290 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.749290 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:31:30.749290 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.749815 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.751339 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:31:30.751989 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:31:30.751989 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:31:30.753012 [info ] [Thread-1 (]: 9 of 47 PASS not_null_dim_instituicao_id_localizacao ........................... [[32mPASS[0m in 0.01s]
[0m06:31:30.753012 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:31:30.753012 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:31:30.754012 [info ] [Thread-1 (]: 10 of 47 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:31:30.754012 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:31:30.754012 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:31:30.757616 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:31:30.758614 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:31:30.760745 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:31:30.761749 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:31:30.761749 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:31:30.761749 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.763252 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.763252 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:31:30.763252 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.765758 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:30.766761 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:31:30.767263 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:31:30.767263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:31:30.767263 [info ] [Thread-1 (]: 10 of 47 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:31:30.768765 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:31:30.768765 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:31:30.769358 [info ] [Thread-1 (]: 11 of 47 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:31:30.769358 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:31:30.769358 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:31:30.773262 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:31:30.774810 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:31:30.776356 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:31:30.777356 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:31:30.778356 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:31:30.779359 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.779868 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.779868 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:31:30.779868 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.786875 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:31:30.788640 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:31:30.789670 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:31:30.789670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:31:30.789670 [info ] [Thread-1 (]: 11 of 47 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:31:30.789670 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:31:30.791186 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:31:30.791748 [info ] [Thread-1 (]: 12 of 47 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:31:30.791748 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:31:30.792257 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:31:30.796056 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:31:30.797148 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:31:30.799844 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:31:30.800850 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:31:30.801354 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:31:30.801865 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.801865 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.801865 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:31:30.802887 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.808875 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:31:30.810427 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:31:30.811035 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:31:30.811035 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:31:30.812063 [info ] [Thread-1 (]: 12 of 47 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:31:30.812063 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:31:30.812063 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:31:30.813452 [info ] [Thread-1 (]: 13 of 47 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:31:30.813452 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:31:30.813452 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:31:30.817335 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:31:30.817335 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:31:30.820887 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:31:30.822589 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:31:30.822589 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:31:30.822589 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.823616 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.823616 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:31:30.823616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.827768 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:31:30.829274 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:31:30.829855 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:31:30.829855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:31:30.829855 [info ] [Thread-1 (]: 13 of 47 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:31:30.829855 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:31:30.829855 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:31:30.831582 [info ] [Thread-1 (]: 14 of 47 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:31:30.831582 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:31:30.831582 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:31:30.886590 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:31:30.888242 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:31:30.889789 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:31:30.890819 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:31:30.890819 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:31:30.890819 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.892435 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.892435 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:31:30.892435 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.896795 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:31:30.897343 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:31:30.898372 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:31:30.898984 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:31:30.899580 [info ] [Thread-1 (]: 14 of 47 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.07s]
[0m06:31:30.899580 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:31:30.899580 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:31:30.899580 [info ] [Thread-1 (]: 15 of 47 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:31:30.900780 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:31:30.901443 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:31:30.903994 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:31:30.905598 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:31:30.907177 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:31:30.908161 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:31:30.908161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:31:30.908161 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.908161 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.908161 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:31:30.909679 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.914508 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:31:30.915529 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:31:30.915529 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:31:30.916670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:31:30.916670 [info ] [Thread-1 (]: 15 of 47 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:31:30.917673 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:31:30.917673 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:31:30.917673 [info ] [Thread-1 (]: 16 of 47 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:31:30.918673 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:31:30.918673 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:31:30.922363 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:31:30.922363 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:31:30.923573 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:31:30.925357 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:31:30.925357 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:31:30.925357 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.926360 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.926360 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:31:30.926360 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.928541 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:30.929064 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:31:30.930093 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:31:30.930093 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:31:30.931195 [info ] [Thread-1 (]: 16 of 47 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:31:30.931195 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:31:30.931699 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:31:30.931699 [info ] [Thread-1 (]: 17 of 47 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:31:30.931699 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:31:30.931699 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:31:30.935617 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:31:30.936623 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:31:30.938917 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:31:30.939429 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:31:30.939429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:31:30.939429 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.939429 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.940944 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:31:30.940944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.944194 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:31:30.944698 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:31:30.946371 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:31:30.946371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:31:30.947039 [info ] [Thread-1 (]: 17 of 47 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:31:30.947039 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:31:30.947039 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:31:30.947039 [info ] [Thread-1 (]: 18 of 47 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:31:30.948643 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:31:30.948643 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:31:30.953981 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:31:30.955523 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:31:30.958549 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:31:30.958549 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:31:30.959528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:31:30.959528 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.959528 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.959528 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:31:30.960615 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:31:30.961630 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:30.964156 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:31:30.964156 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:31:30.964156 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:31:30.964156 [info ] [Thread-1 (]: 18 of 47 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:31:30.966040 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:31:30.966040 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:31:30.966040 [info ] [Thread-1 (]: 19 of 47 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:31:30.967045 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:31:30.967045 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:31:30.970063 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:31:30.971082 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:31:30.972593 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:31:30.973097 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:31:30.973097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:31:30.973097 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.973097 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.974616 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:31:30.974616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.974616 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.976128 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:31:30.977135 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:31:30.977135 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:31:30.977135 [info ] [Thread-1 (]: 19 of 47 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:31:30.978134 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:31:30.978134 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:31:30.978134 [info ] [Thread-1 (]: 20 of 47 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:31:30.979160 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:31:30.979160 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:31:30.982989 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:31:30.982989 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:31:30.985532 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:31:30.986543 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:31:30.986543 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:31:30.986543 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.986543 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.987544 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:31:30.987544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:30.988644 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:30.989647 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:31:30.991167 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:31:30.991167 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:31:30.991713 [info ] [Thread-1 (]: 20 of 47 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.01s]
[0m06:31:30.992232 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:31:30.992232 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:31:30.992232 [info ] [Thread-1 (]: 21 of 47 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:31:30.993237 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:31:30.993237 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:31:30.996257 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:31:30.996923 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:31:30.998487 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:31:30.999049 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:31:30.999049 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:31:30.999674 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:30.999674 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:30.999674 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:31:30.999674 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:31:31.001197 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.003723 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:31:31.004827 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:31:31.004827 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:31:31.005348 [info ] [Thread-1 (]: 21 of 47 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.01s]
[0m06:31:31.005348 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:31:31.005348 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:31:31.006376 [info ] [Thread-1 (]: 22 of 47 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:31:31.006376 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:31:31.006376 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:31:31.008415 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:31:31.009921 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:31:31.012290 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:31:31.012290 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:31:31.013289 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:31:31.013289 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.013829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.014332 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:31:31.014332 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.014332 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.015873 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:31:31.016476 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:31:31.017050 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:31:31.017050 [info ] [Thread-1 (]: 22 of 47 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m06:31:31.018061 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:31:31.018061 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:31:31.018061 [info ] [Thread-1 (]: 23 of 47 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:31:31.019062 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:31:31.019062 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:31:31.023618 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:31:31.023618 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:31:31.025637 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:31:31.026643 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:31:31.026643 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:31:31.027643 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.027643 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.027643 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:31:31.027643 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.032865 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:31:31.033930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:31:31.034936 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:31:31.034936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:31:31.035442 [info ] [Thread-1 (]: 23 of 47 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:31:31.035442 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:31:31.035442 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:31:31.035442 [info ] [Thread-1 (]: 24 of 47 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:31:31.036957 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:31:31.036957 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:31:31.041156 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:31:31.042670 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:31:31.044689 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:31:31.044689 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:31:31.046240 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:31:31.046776 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.047330 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.047330 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:31:31.047330 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.049384 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:31.051626 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:31:31.051626 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:31:31.052657 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:31:31.053187 [info ] [Thread-1 (]: 24 of 47 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:31:31.053693 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:31:31.053693 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:31:31.053693 [info ] [Thread-1 (]: 25 of 47 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:31:31.053693 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:31:31.053693 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:31:31.058756 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:31:31.059757 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:31:31.061916 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:31:31.062917 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:31:31.063423 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:31:31.063423 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.063423 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.064429 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:31:31.064429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.066570 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:31.067118 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:31:31.068149 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:31:31.068671 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:31:31.069271 [info ] [Thread-1 (]: 25 of 47 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:31:31.069271 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:31:31.069271 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:31:31.069271 [info ] [Thread-1 (]: 26 of 47 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:31:31.069271 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:31:31.070906 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:31:31.077490 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:31:31.079508 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:31:31.082176 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:31:31.083234 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:31:31.083741 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:31:31.083741 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.084270 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.084270 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:31:31.084793 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.087420 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:31.087944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:31:31.088984 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:31:31.088984 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:31:31.089997 [info ] [Thread-1 (]: 26 of 47 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:31:31.090501 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:31:31.091016 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:31:31.091016 [info ] [Thread-1 (]: 27 of 47 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:31:31.091526 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:31:31.091526 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:31:31.094693 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:31:31.094693 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:31:31.098509 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:31:31.099582 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:31:31.099582 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:31:31.099582 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.100610 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.100610 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:31:31.101134 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.102802 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:31.103820 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:31:31.103820 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:31:31.105415 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:31:31.105415 [info ] [Thread-1 (]: 27 of 47 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:31:31.105415 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:31:31.106427 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:31:31.106427 [info ] [Thread-1 (]: 28 of 47 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:31:31.106427 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:31:31.107444 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:31:31.110748 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:31:31.110748 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:31:31.113283 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:31:31.113283 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:31:31.114295 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:31:31.114295 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.114295 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.114295 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:31:31.114295 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.116544 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.117134 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:31:31.118162 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:31:31.118162 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:31:31.118162 [info ] [Thread-1 (]: 28 of 47 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:31:31.119163 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:31:31.119163 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:31:31.119163 [info ] [Thread-1 (]: 29 of 47 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:31:31.119163 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:31:31.120309 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:31:31.123412 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:31:31.124444 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:31:31.126120 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:31:31.126120 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:31:31.127130 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:31:31.127130 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.127130 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.128143 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:31:31.128143 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.129740 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:31.130769 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:31:31.131871 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:31:31.131871 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:31:31.131871 [info ] [Thread-1 (]: 29 of 47 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:31:31.132883 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:31:31.132883 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:31:31.132883 [info ] [Thread-1 (]: 30 of 47 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:31:31.132883 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:31:31.134008 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:31:31.136124 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:31:31.137629 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:31:31.138844 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:31:31.139850 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:31:31.139850 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:31:31.140855 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.141372 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.141372 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:31:31.141372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:31:31.143753 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:31.143753 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:31:31.145283 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:31:31.145283 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:31:31.146412 [info ] [Thread-1 (]: 30 of 47 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m06:31:31.146763 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:31:31.147291 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:31:31.147291 [info ] [Thread-1 (]: 31 of 47 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:31:31.147291 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:31:31.147291 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:31:31.150746 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:31:31.151278 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:31:31.152855 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:31:31.153855 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:31:31.153855 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:31:31.154359 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.154359 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.154359 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:31:31.154359 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.155878 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:31.156907 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:31:31.157440 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:31:31.157440 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:31:31.157440 [info ] [Thread-1 (]: 31 of 47 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:31:31.158451 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:31:31.158451 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:31:31.158451 [info ] [Thread-1 (]: 32 of 47 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:31:31.158451 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:31:31.159955 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:31:31.163071 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:31:31.164644 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:31:31.166853 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:31:31.167857 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:31:31.167857 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:31:31.167857 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.168857 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.168857 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:31:31.169899 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.171413 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.172445 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:31:31.173475 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:31:31.173475 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:31:31.174582 [info ] [Thread-1 (]: 32 of 47 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.02s]
[0m06:31:31.174582 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:31:31.175499 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:31:31.175499 [info ] [Thread-1 (]: 33 of 47 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:31:31.175499 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:31:31.175499 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:31:31.179594 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:31:31.179594 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:31:31.181708 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:31:31.183234 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:31:31.183234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:31:31.183887 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.183887 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.183887 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:31:31.184908 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.187442 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:31.187962 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:31:31.188607 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:31:31.188607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:31:31.189636 [info ] [Thread-1 (]: 33 of 47 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:31:31.189636 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:31:31.189636 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:31:31.189636 [info ] [Thread-1 (]: 34 of 47 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:31:31.191163 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:31:31.191163 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:31:31.194836 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:31:31.194836 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:31:31.197081 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:31:31.197081 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:31:31.197081 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:31:31.197081 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:31.198686 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:31.198686 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:31:31.199398 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:31:31.204194 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:31:31.205216 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:31:31.205737 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:31:31.205737 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:31:31.206764 [info ] [Thread-1 (]: 34 of 47 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:31:31.206764 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:31:31.206764 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:31:31.207768 [info ] [Thread-1 (]: 35 of 47 SKIP relation main.dim_consolidado .................................... [[33mSKIP[0m]
[0m06:31:31.207768 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:31:31.207768 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:31:31.208752 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_consolidado' to be skipped because of status 'skipped'. 
[0m06:31:31.208752 [info ] [Thread-1 (]: 36 of 47 SKIP relation main.dim_controle ....................................... [[33mSKIP[0m]
[0m06:31:31.208752 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:31:31.209749 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:31:31.209749 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_controle' to be skipped because of status 'skipped'. 
[0m06:31:31.210343 [info ] [Thread-1 (]: 37 of 47 SKIP relation main.dim_segmento ....................................... [[33mSKIP[0m]
[0m06:31:31.210897 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:31:31.210897 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:31:31.210897 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_segmento' to be skipped because of status 'skipped'. 
[0m06:31:31.210897 [info ] [Thread-1 (]: 38 of 47 SKIP test not_null_dim_consolidado_id_consolidado ..................... [[33mSKIP[0m]
[0m06:31:31.211901 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:31:31.211901 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:31:31.211901 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340' to be skipped because of status 'skipped'. 
[0m06:31:31.212901 [info ] [Thread-1 (]: 39 of 47 SKIP test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[33mSKIP[0m]
[0m06:31:31.212901 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:31:31.212901 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:31:31.213941 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e' to be skipped because of status 'skipped'. 
[0m06:31:31.213941 [info ] [Thread-1 (]: 40 of 47 SKIP test unique_dim_consolidado_id_consolidado ....................... [[33mSKIP[0m]
[0m06:31:31.214494 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:31:31.214494 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:31:31.214494 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862' to be skipped because of status 'skipped'. 
[0m06:31:31.214494 [info ] [Thread-1 (]: 41 of 47 SKIP test not_null_dim_controle_id_controle ........................... [[33mSKIP[0m]
[0m06:31:31.215497 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:31:31.215497 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:31:31.215497 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21' to be skipped because of status 'skipped'. 
[0m06:31:31.216629 [info ] [Thread-1 (]: 42 of 47 SKIP test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[33mSKIP[0m]
[0m06:31:31.216629 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:31:31.216629 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:31:31.216629 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f' to be skipped because of status 'skipped'. 
[0m06:31:31.216629 [info ] [Thread-1 (]: 43 of 47 SKIP test unique_dim_controle_id_controle ............................. [[33mSKIP[0m]
[0m06:31:31.217891 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:31:31.217891 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:31:31.217891 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c' to be skipped because of status 'skipped'. 
[0m06:31:31.217891 [info ] [Thread-1 (]: 44 of 47 SKIP test not_null_dim_segmento_id_segmento ........................... [[33mSKIP[0m]
[0m06:31:31.218891 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:31:31.218891 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:31:31.218891 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e' to be skipped because of status 'skipped'. 
[0m06:31:31.218891 [info ] [Thread-1 (]: 45 of 47 SKIP test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[33mSKIP[0m]
[0m06:31:31.220140 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:31:31.220140 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:31:31.220659 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e' to be skipped because of status 'skipped'. 
[0m06:31:31.220659 [info ] [Thread-1 (]: 46 of 47 SKIP test unique_dim_segmento_id_segmento ............................. [[33mSKIP[0m]
[0m06:31:31.220659 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:31:31.220659 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a' to be skipped because of status 'skipped'. 
[0m06:31:31.222212 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:31:31.222212 [info ] [Thread-1 (]: 47 of 47 SKIP relation main.view_resumo_financeiro_relatorios .................. [[33mSKIP[0m]
[0m06:31:31.222212 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:31:31.222212 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' to be skipped because of status 'skipped'. 
[0m06:31:31.223219 [debug] [MainThread]: Using duckdb connection "master"
[0m06:31:31.224429 [debug] [MainThread]: On master: BEGIN
[0m06:31:31.224429 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:31:31.225445 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m06:31:31.225445 [debug] [MainThread]: On master: COMMIT
[0m06:31:31.225445 [debug] [MainThread]: Using duckdb connection "master"
[0m06:31:31.225445 [debug] [MainThread]: On master: COMMIT
[0m06:31:31.226479 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:31:31.226479 [debug] [MainThread]: On master: Close
[0m06:31:31.226479 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:31:31.227476 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:31:31.227476 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:31:31.227476 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a' was properly closed.
[0m06:31:31.227476 [info ] [MainThread]: 
[0m06:31:31.228460 [info ] [MainThread]: Finished running 3 seeds, 7 table models, 36 data tests, 1 view model in 0 hours 0 minutes and 2.02 seconds (2.02s).
[0m06:31:31.231894 [debug] [MainThread]: Command end result
[0m06:31:31.261088 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:31:31.263376 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:31:31.267057 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:31:31.268571 [info ] [MainThread]: 
[0m06:31:31.268571 [info ] [MainThread]: [31mCompleted with 3 errors, 0 partial successes, and 0 warnings:[0m
[0m06:31:31.269087 [info ] [MainThread]: 
[0m06:31:31.269087 [error] [MainThread]: [31mFailure in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)[0m
[0m06:31:31.269087 [error] [MainThread]:   Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv"
[0m06:31:31.269087 [info ] [MainThread]: 
[0m06:31:31.269087 [error] [MainThread]: [31mFailure in seed seed_dim_controle (seeds\seed_dim_controle.csv)[0m
[0m06:31:31.269087 [error] [MainThread]:   Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv"
[0m06:31:31.270672 [info ] [MainThread]: 
[0m06:31:31.270672 [error] [MainThread]: [31mFailure in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)[0m
[0m06:31:31.270672 [error] [MainThread]:   Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv"
[0m06:31:31.270672 [info ] [MainThread]: 
[0m06:31:31.270672 [info ] [MainThread]: Done. PASS=31 WARN=0 ERROR=3 SKIP=13 NO-OP=0 TOTAL=47
[0m06:31:31.270672 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 21 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:31:31.272197 [debug] [MainThread]: Command `dbt build` failed at 06:31:31.272197 after 3.41 seconds
[0m06:31:31.272197 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002039F517320>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002039EC87530>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002039EC871D0>]}
[0m06:31:31.272197 [debug] [MainThread]: Flushing usage events
[0m06:31:32.072379 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:31:58.208929 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029431C04EF0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029431C07140>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029432788E90>]}


============================== 06:31:58.211949 | 0118007a-b82f-45e0-98fd-5ff68b51b0eb ==============================
[0m06:31:58.211949 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:31:58.212957 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'src/bacen_ifdata/data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'indirect_selection': 'eager', 'use_colors': 'True', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios --project-dir src/bacen_ifdata/data_analytics --profiles-dir src/bacen_ifdata/data_analytics', 'use_experimental_parser': 'False', 'log_path': 'src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:31:58.386242 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029433DF3530>]}
[0m06:31:58.434532 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029432BA0470>]}
[0m06:31:58.436664 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:31:58.642043 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:31:58.779979 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
[0m06:31:58.781007 [debug] [MainThread]: Nothing changed, skipping partial parsing.
[0m06:31:58.781007 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing
[0m06:31:58.786650 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:31:58.818962 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029432B4B7A0>]}
[0m06:31:58.896349 [debug] [MainThread]: Wrote artifact WritableManifest to src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:31:58.899093 [debug] [MainThread]: Wrote artifact SemanticManifest to src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:31:58.982003 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029434217C50>]}
[0m06:31:58.983147 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:31:58.987850 [info ] [MainThread]: 
[0m06:31:58.988598 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:31:58.988598 [info ] [MainThread]: 
[0m06:31:58.988598 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:31:58.993248 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:31:59.054229 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:31:59.054229 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:31:59.054229 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:31:59.158534 [debug] [ThreadPool]: SQL status: OK in 0.104 seconds
[0m06:31:59.158534 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:31:59.160998 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:31:59.160998 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:31:59.164791 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:31:59.166051 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:31:59.166051 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:31:59.166051 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:31:59.167062 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:31:59.167062 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:31:59.167062 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:31:59.168593 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:31:59.168593 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:31:59.169174 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:31:59.169174 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:31:59.169174 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:31:59.169174 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:31:59.169174 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:31:59.169174 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:31:59.172219 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:31:59.175590 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:31:59.176601 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:31:59.176601 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:31:59.176601 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:31:59.176601 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:31:59.177600 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:31:59.186264 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m06:31:59.188346 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:31:59.189375 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:31:59.189375 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:31:59.192392 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029433E9DFD0>]}
[0m06:31:59.193395 [debug] [MainThread]: Using duckdb connection "master"
[0m06:31:59.193395 [debug] [MainThread]: On master: BEGIN
[0m06:31:59.193395 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:31:59.193395 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:31:59.193395 [debug] [MainThread]: On master: COMMIT
[0m06:31:59.193395 [debug] [MainThread]: Using duckdb connection "master"
[0m06:31:59.194939 [debug] [MainThread]: On master: COMMIT
[0m06:31:59.194939 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:31:59.194939 [debug] [MainThread]: On master: Close
[0m06:31:59.198619 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:31:59.198619 [info ] [Thread-1 (]: 1 of 47 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:31:59.199170 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:31:59.199170 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:31:59.213156 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.213156 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:31:59.233774 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.235286 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.235286 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:31:59.235286 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:31:59.236293 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:59.236293 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.236293 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
            ELSE 'Outros'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:31:59.707238 [debug] [Thread-1 (]: SQL status: OK in 0.469 seconds
[0m06:31:59.710851 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.711871 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:31:59.711871 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.713396 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.713396 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:31:59.714412 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.718666 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.718666 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:31:59.719277 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.721981 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.721981 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:31:59.722994 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.731974 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:31:59.733001 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.733001 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:31:59.744773 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m06:31:59.749160 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:31:59.749811 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:31:59.750823 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:59.752475 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:31:59.754019 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029431BD02F0>]}
[0m06:31:59.755575 [info ] [Thread-1 (]: 1 of 47 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.55s]
[0m06:31:59.755575 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:31:59.755575 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:31:59.756588 [info ] [Thread-1 (]: 2 of 47 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:31:59.756588 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:31:59.757604 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:31:59.760717 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.761752 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:31:59.764307 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.764846 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.764846 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:31:59.765352 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:59.765915 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.765915 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.766433 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:31:59.813104 [debug] [Thread-1 (]: SQL status: OK in 0.047 seconds
[0m06:31:59.813684 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.814718 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:31:59.815243 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.816404 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.816404 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:31:59.816965 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.818980 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.818980 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m06:31:59.818980 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.822114 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.822114 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:31:59.822114 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.823144 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:31:59.823144 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.823144 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:31:59.826238 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:31:59.827247 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:31:59.828245 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:31:59.829418 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:59.830058 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:31:59.830058 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029434703920>]}
[0m06:31:59.831164 [info ] [Thread-1 (]: 2 of 47 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.07s]
[0m06:31:59.831164 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:31:59.831164 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:31:59.831164 [info ] [Thread-1 (]: 3 of 47 START sql table model main.dim_tempo ................................... [RUN]
[0m06:31:59.832661 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:31:59.832661 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:31:59.839476 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.839476 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:31:59.842088 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.844639 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.844639 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:31:59.845158 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:59.845703 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.845703 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.846353 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:31:59.895932 [debug] [Thread-1 (]: SQL status: OK in 0.049 seconds
[0m06:31:59.896522 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.897114 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:31:59.897114 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.898722 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.898722 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:31:59.899909 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.901643 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.901643 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:31:59.902672 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.904206 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.904206 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:31:59.905727 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.905727 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:31:59.906751 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.906751 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:31:59.908360 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:59.909885 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:31:59.910929 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:31:59.911542 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:31:59.911542 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:31:59.913074 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029434880080>]}
[0m06:31:59.913074 [info ] [Thread-1 (]: 3 of 47 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.08s]
[0m06:31:59.913074 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:31:59.913074 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:31:59.913074 [info ] [Thread-1 (]: 4 of 47 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m06:31:59.914613 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:31:59.914613 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:31:59.917632 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:59.919139 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:31:59.921822 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:59.922383 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:59.923455 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:31:59.923455 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:31:59.923455 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:31:59.923455 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:31:59.923455 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:32:00.271929 [debug] [Thread-1 (]: SQL status: OK in 0.347 seconds
[0m06:32:00.271929 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:32:00.271929 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:32:00.273519 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.274555 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:32:00.274555 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:32:00.275276 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.277327 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:32:00.278323 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m06:32:00.278323 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.279867 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:32:00.279867 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:32:00.281595 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.281595 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:32:00.281595 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:32:00.283227 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:32:00.486526 [debug] [Thread-1 (]: SQL status: OK in 0.203 seconds
[0m06:32:00.491281 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:32:00.492287 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:32:00.494888 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.497093 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:32:00.497093 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000294348E8830>]}
[0m06:32:00.499107 [info ] [Thread-1 (]: 4 of 47 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.58s]
[0m06:32:00.499813 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:32:00.499813 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:32:00.500821 [info ] [Thread-1 (]: 5 of 47 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m06:32:00.501325 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:32:00.501886 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:32:00.501886 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:32:00.527857 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:32:00.530132 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:32:00.530132 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.532191 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.532191 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:32:00.533232 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m06:32:00.533869 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.543170 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:32:00.543170 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:32:00.547678 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:32:00.551660 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:32:00.553674 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:32:00.555614 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:32:00.555614 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:32:00.558128 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.559638 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:32:00.559638 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000294348E9280>]}
[0m06:32:00.560259 [info ] [Thread-1 (]: 5 of 47 OK loaded seed file main.seed_dim_consolidado .......................... [[32mINSERT 8[0m in 0.06s]
[0m06:32:00.561009 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:32:00.562023 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:32:00.563017 [info ] [Thread-1 (]: 6 of 47 START seed file main.seed_dim_controle ................................. [RUN]
[0m06:32:00.563521 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:32:00.563521 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:32:00.563521 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:32:00.568051 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:32:00.568051 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:32:00.569372 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.569372 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.569372 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:32:00.569372 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m06:32:00.571178 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.572288 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:32:00.572288 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:32:00.574407 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.575513 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:32:00.577544 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:32:00.577544 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:32:00.577544 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:32:00.579643 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.579643 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:32:00.581401 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029434770920>]}
[0m06:32:00.581968 [info ] [Thread-1 (]: 6 of 47 OK loaded seed file main.seed_dim_controle ............................. [[32mINSERT 3[0m in 0.02s]
[0m06:32:00.581968 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:32:00.581968 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:32:00.581968 [info ] [Thread-1 (]: 7 of 47 START seed file main.seed_dim_segmento ................................. [RUN]
[0m06:32:00.583486 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:32:00.584493 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:32:00.584493 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:32:00.590895 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:32:00.592645 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:32:00.592645 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.593289 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.593289 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:32:00.593802 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m06:32:00.593802 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.594808 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:32:00.594808 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:32:00.598581 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.599638 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:32:00.601169 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:32:00.601792 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:32:00.601792 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:32:00.603803 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.603803 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:32:00.603803 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000294348A6870>]}
[0m06:32:00.605461 [info ] [Thread-1 (]: 7 of 47 OK loaded seed file main.seed_dim_segmento ............................. [[32mINSERT 5[0m in 0.02s]
[0m06:32:00.605461 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:32:00.605461 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:32:00.606490 [info ] [Thread-1 (]: 8 of 47 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:32:00.606490 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:32:00.607472 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:32:00.617229 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:32:00.617229 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:32:00.631480 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:32:00.632318 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:32:00.632318 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:32:00.632318 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.633433 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.633433 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:32:00.633433 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.634854 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.636539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:32:00.638044 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:32:00.638367 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:32:00.638367 [info ] [Thread-1 (]: 8 of 47 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m06:32:00.638871 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:32:00.638871 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:32:00.638871 [info ] [Thread-1 (]: 9 of 47 START test not_null_dim_instituicao_id_localizacao ..................... [RUN]
[0m06:32:00.639877 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:32:00.639877 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:32:00.642386 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:32:00.643392 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:32:00.645378 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:32:00.645904 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:32:00.646910 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:32:00.646910 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.647416 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.647416 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:32:00.647416 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.648921 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.649480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:32:00.649480 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:32:00.651120 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:32:00.651120 [info ] [Thread-1 (]: 9 of 47 PASS not_null_dim_instituicao_id_localizacao ........................... [[32mPASS[0m in 0.01s]
[0m06:32:00.651756 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:32:00.651756 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:32:00.651756 [info ] [Thread-1 (]: 10 of 47 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:32:00.652761 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:32:00.652761 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:32:00.658724 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:32:00.658724 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:32:00.660824 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:32:00.663349 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:32:00.663349 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:32:00.664365 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.665911 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.666434 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:32:00.667077 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.669592 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.670967 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:32:00.673344 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:32:00.674355 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:32:00.675573 [info ] [Thread-1 (]: 10 of 47 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:32:00.676584 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:32:00.677653 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:32:00.677653 [info ] [Thread-1 (]: 11 of 47 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:32:00.677653 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:32:00.679161 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:32:00.687877 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:32:00.689521 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:32:00.692042 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:32:00.694806 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:32:00.694806 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:32:00.694806 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.696575 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.696575 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:32:00.697726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.702974 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:32:00.703993 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:32:00.704527 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:32:00.704527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:32:00.705549 [info ] [Thread-1 (]: 11 of 47 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:32:00.705549 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:32:00.705549 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:32:00.706661 [info ] [Thread-1 (]: 12 of 47 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:32:00.706661 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:32:00.707564 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:32:00.713302 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:32:00.715101 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:32:00.718017 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:32:00.720153 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:32:00.720661 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:32:00.720661 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.722939 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.723467 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:32:00.724482 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.736388 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:32:00.738600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:32:00.739611 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:32:00.741136 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:32:00.742156 [info ] [Thread-1 (]: 12 of 47 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:32:00.743356 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:32:00.743356 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:32:00.745028 [info ] [Thread-1 (]: 13 of 47 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:32:00.745028 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:32:00.746608 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:32:00.757608 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:32:00.758607 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:32:00.760618 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:32:00.760618 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:32:00.761624 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:32:00.761624 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.761624 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.762631 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:32:00.762631 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.767419 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:32:00.767419 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:32:00.768924 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:32:00.769965 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:32:00.769965 [info ] [Thread-1 (]: 13 of 47 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:32:00.770929 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:32:00.770929 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:32:00.770929 [info ] [Thread-1 (]: 14 of 47 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:32:00.772015 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:32:00.772015 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:32:00.775173 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:32:00.776176 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:32:00.778198 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:32:00.779196 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:32:00.779196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:32:00.779837 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.779837 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.779837 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:32:00.780867 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.784522 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:32:00.785547 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:32:00.786644 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:32:00.786644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:32:00.786644 [info ] [Thread-1 (]: 14 of 47 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:32:00.787622 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:32:00.787622 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:32:00.788217 [info ] [Thread-1 (]: 15 of 47 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:32:00.788217 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:32:00.789221 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:32:00.792447 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:32:00.793461 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:32:00.795023 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:32:00.795023 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:32:00.796792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:32:00.796792 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.797530 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.797530 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:32:00.797530 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.807549 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:32:00.808537 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:32:00.810065 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:32:00.810065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:32:00.810634 [info ] [Thread-1 (]: 15 of 47 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:32:00.810634 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:32:00.811645 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:32:00.811645 [info ] [Thread-1 (]: 16 of 47 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:32:00.811645 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:32:00.811645 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:32:00.815793 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:32:00.816604 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:32:00.817634 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:32:00.819164 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:32:00.819164 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:32:00.819164 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.819164 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.820836 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:32:00.820836 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.823112 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.824236 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:32:00.824236 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:32:00.825285 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:32:00.825285 [info ] [Thread-1 (]: 16 of 47 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:32:00.826295 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:32:00.826295 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:32:00.826829 [info ] [Thread-1 (]: 17 of 47 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:32:00.826829 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:32:00.826829 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:32:00.831584 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:32:00.832591 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:32:00.835450 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:32:00.836454 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:32:00.836454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:32:00.836454 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.836454 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.837961 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:32:00.837961 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.841703 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:32:00.842590 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:32:00.843595 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:32:00.843953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:32:00.843953 [info ] [Thread-1 (]: 17 of 47 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:32:00.844958 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:32:00.844958 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:32:00.844958 [info ] [Thread-1 (]: 18 of 47 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:32:00.844958 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:32:00.844958 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:32:00.849801 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:32:00.851629 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:32:00.852742 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:32:00.852742 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:32:00.852742 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:32:00.854363 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.854363 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.854363 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:32:00.854363 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:32:00.857605 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.858735 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:32:00.859721 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:32:00.860226 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:32:00.860748 [info ] [Thread-1 (]: 18 of 47 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:32:00.860748 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:32:00.860748 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:32:00.860748 [info ] [Thread-1 (]: 19 of 47 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:32:00.861753 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:32:00.861753 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:32:00.865101 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:32:00.865708 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:32:00.866839 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:32:00.868148 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:32:00.868148 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:32:00.868148 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.869134 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.869134 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:32:00.869639 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.870144 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.871195 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:32:00.871195 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:32:00.872519 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:32:00.872519 [info ] [Thread-1 (]: 19 of 47 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:32:00.873120 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:32:00.873120 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:32:00.873120 [info ] [Thread-1 (]: 20 of 47 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:32:00.873120 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:32:00.873120 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:32:00.877962 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:32:00.879466 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:32:00.881192 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:32:00.881697 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:32:00.883254 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:32:00.884268 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.885776 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.886788 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:32:00.887790 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.892717 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:32:00.896938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:32:00.899449 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:32:00.899449 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:32:00.901571 [info ] [Thread-1 (]: 20 of 47 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.03s]
[0m06:32:00.902582 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:32:00.903581 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:32:00.904089 [info ] [Thread-1 (]: 21 of 47 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:32:00.905598 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:32:00.905598 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:32:00.910753 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:32:00.911763 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:32:00.916817 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:32:00.919335 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:32:00.919335 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:32:00.920844 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.921854 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.922366 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:32:00.923675 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:32:00.926977 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.929459 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:32:00.931003 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:32:00.931003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:32:00.932347 [info ] [Thread-1 (]: 21 of 47 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.03s]
[0m06:32:00.933357 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:32:00.933867 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:32:00.933867 [info ] [Thread-1 (]: 22 of 47 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:32:00.934880 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:32:00.935453 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:32:00.940377 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:32:00.940892 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:32:00.943650 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:32:00.944628 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:32:00.944628 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:32:00.944628 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.944628 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.946282 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:32:00.946282 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.947057 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.949087 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:32:00.949621 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:32:00.951194 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:32:00.951846 [info ] [Thread-1 (]: 22 of 47 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:32:00.952856 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:32:00.953857 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:32:00.954366 [info ] [Thread-1 (]: 23 of 47 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:32:00.955374 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:32:00.955374 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:32:00.961577 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:32:00.961577 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:32:00.964763 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:32:00.965773 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:32:00.966278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:32:00.966278 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.966879 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:00.966879 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:32:00.967885 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.970895 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:32:00.972406 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:32:00.973411 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:32:00.973411 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:32:00.973411 [info ] [Thread-1 (]: 23 of 47 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:32:00.974418 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:32:00.974923 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:32:00.974923 [info ] [Thread-1 (]: 24 of 47 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:32:00.975467 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:32:00.975467 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:32:00.979023 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:32:00.980056 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:32:00.982143 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:32:00.983895 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:32:00.983895 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:32:00.983895 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.984927 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.985434 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:32:00.985434 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:00.987983 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:00.988556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:32:00.989584 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:32:00.989584 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:32:00.989584 [info ] [Thread-1 (]: 24 of 47 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:32:00.989584 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:32:00.991091 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:32:00.991091 [info ] [Thread-1 (]: 25 of 47 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:32:00.991091 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:32:00.991091 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:32:00.994724 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:32:00.994724 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:32:00.996954 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:32:00.996954 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:32:00.996954 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:32:00.998564 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:00.999152 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:00.999152 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:32:00.999152 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.001231 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:01.001876 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:32:01.002898 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:32:01.002898 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:32:01.003879 [info ] [Thread-1 (]: 25 of 47 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:32:01.004383 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:32:01.004383 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:32:01.004383 [info ] [Thread-1 (]: 26 of 47 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:32:01.005387 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:32:01.005387 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:32:01.008937 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:32:01.009950 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:32:01.011524 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:32:01.013050 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:32:01.013050 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:32:01.013050 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.014613 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.014613 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:32:01.015632 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.019181 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:32:01.020887 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:32:01.021924 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:32:01.021924 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:32:01.022461 [info ] [Thread-1 (]: 26 of 47 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:32:01.022969 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:32:01.022969 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:32:01.023495 [info ] [Thread-1 (]: 27 of 47 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:32:01.023495 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:32:01.023495 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:32:01.027056 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:32:01.028056 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:32:01.029593 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:32:01.031861 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:32:01.031861 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:32:01.031861 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.034285 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.034961 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:32:01.035494 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.039270 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:32:01.040288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:32:01.041286 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:32:01.041286 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:32:01.041823 [info ] [Thread-1 (]: 27 of 47 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:32:01.042329 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:32:01.042329 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:32:01.042329 [info ] [Thread-1 (]: 28 of 47 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:32:01.043333 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:32:01.043333 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:32:01.047154 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:32:01.047154 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:32:01.049277 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:32:01.050003 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:32:01.050003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:32:01.050003 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.051034 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.051540 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:32:01.051540 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.052561 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.053561 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:32:01.053561 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:32:01.055141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:32:01.055141 [info ] [Thread-1 (]: 28 of 47 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:32:01.055683 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:32:01.055683 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:32:01.055683 [info ] [Thread-1 (]: 29 of 47 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:32:01.056694 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:32:01.056694 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:32:01.060823 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:32:01.060823 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:32:01.063350 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:32:01.063350 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:32:01.064362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:32:01.064362 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.064892 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.064892 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:32:01.065417 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.067131 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:01.068163 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:32:01.069158 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:32:01.069158 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:32:01.069158 [info ] [Thread-1 (]: 29 of 47 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:32:01.070301 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:32:01.070301 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:32:01.070847 [info ] [Thread-1 (]: 30 of 47 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:32:01.070847 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:32:01.070847 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:32:01.073564 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:32:01.075076 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:32:01.076084 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:32:01.077088 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:32:01.077088 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:32:01.078090 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.078090 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.078090 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:32:01.078090 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:32:01.079943 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.081553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:32:01.082189 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:32:01.082189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:32:01.082189 [info ] [Thread-1 (]: 30 of 47 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m06:32:01.083301 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:32:01.083301 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:32:01.084051 [info ] [Thread-1 (]: 31 of 47 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:32:01.084051 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:32:01.084751 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:32:01.088075 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:32:01.089006 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:32:01.091112 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:32:01.092354 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:32:01.092354 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:32:01.093533 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.093533 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.093533 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:32:01.093533 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.094681 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.096240 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:32:01.096803 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:32:01.096803 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:32:01.097354 [info ] [Thread-1 (]: 31 of 47 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:32:01.097354 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:32:01.097354 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:32:01.098383 [info ] [Thread-1 (]: 32 of 47 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:32:01.098912 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:32:01.098912 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:32:01.101249 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:32:01.101985 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:32:01.104011 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:32:01.104011 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:32:01.104011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:32:01.104011 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.105594 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.105594 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:32:01.105594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.106598 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.107601 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:32:01.108602 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:32:01.109602 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:32:01.110108 [info ] [Thread-1 (]: 32 of 47 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:32:01.110613 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:32:01.110613 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:32:01.110613 [info ] [Thread-1 (]: 33 of 47 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:32:01.110613 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:32:01.111618 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:32:01.114715 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:32:01.115722 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:32:01.117738 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:32:01.117738 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:32:01.117738 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:32:01.117738 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.119244 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.119244 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:32:01.119244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.123410 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:32:01.125049 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:32:01.126175 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:32:01.126175 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:32:01.126787 [info ] [Thread-1 (]: 33 of 47 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:32:01.126787 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:32:01.126787 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:32:01.127789 [info ] [Thread-1 (]: 34 of 47 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:32:01.127789 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:32:01.127789 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:32:01.131671 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:32:01.131671 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:32:01.133969 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:32:01.135083 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:32:01.135083 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:32:01.135083 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.135083 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.136370 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:32:01.136370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.141081 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:32:01.142592 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:32:01.142592 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:32:01.143598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:32:01.143598 [info ] [Thread-1 (]: 34 of 47 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:32:01.143598 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:32:01.143598 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:32:01.145317 [info ] [Thread-1 (]: 35 of 47 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:32:01.145317 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:32:01.145317 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:32:01.147424 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.147424 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:32:01.150740 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.151875 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.151875 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:32:01.152986 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.152986 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.154015 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.154015 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:32:01.154529 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.155640 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.155640 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m06:32:01.155640 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.157183 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.157183 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m06:32:01.158223 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.161477 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.161477 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m06:32:01.161477 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.163475 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.163475 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:32:01.164572 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.165664 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:32:01.165664 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.165664 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:32:01.166990 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.168997 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:32:01.169501 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:32:01.169501 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.171315 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:32:01.171315 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029455346C90>]}
[0m06:32:01.172014 [info ] [Thread-1 (]: 35 of 47 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:32:01.172518 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:32:01.172518 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:32:01.172518 [info ] [Thread-1 (]: 36 of 47 START sql table model main.dim_controle ............................... [RUN]
[0m06:32:01.173528 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:32:01.173528 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:32:01.175040 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.176553 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:32:01.179068 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.179068 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.180075 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:32:01.180075 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.180580 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.180580 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.181085 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:32:01.182090 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.182090 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.183332 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m06:32:01.184132 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.184909 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.184909 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m06:32:01.185579 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.187689 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.188322 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m06:32:01.188322 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.189429 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.189429 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:32:01.190988 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.192030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:32:01.192030 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.192030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:32:01.192030 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.195139 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:32:01.195139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:32:01.196142 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.196766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:32:01.197573 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000294552C3FE0>]}
[0m06:32:01.197573 [info ] [Thread-1 (]: 36 of 47 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.02s]
[0m06:32:01.198603 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:32:01.199110 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:32:01.199780 [info ] [Thread-1 (]: 37 of 47 START sql table model main.dim_segmento ............................... [RUN]
[0m06:32:01.199780 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:32:01.199780 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:32:01.201953 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.202959 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:32:01.206474 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.206979 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.206979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:32:01.206979 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.207985 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.207985 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.207985 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:32:01.208985 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.209985 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.210491 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m06:32:01.210491 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.211498 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.212498 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m06:32:01.212498 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.214845 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.215587 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m06:32:01.215587 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.218126 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.218126 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:32:01.219021 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.219021 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:32:01.219021 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.219021 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:32:01.220673 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.222420 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:32:01.222420 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:32:01.223535 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.224676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:32:01.225289 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000294553AE630>]}
[0m06:32:01.225289 [info ] [Thread-1 (]: 37 of 47 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m06:32:01.226293 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:32:01.227296 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:32:01.227296 [info ] [Thread-1 (]: 38 of 47 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:32:01.227296 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:32:01.228293 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:32:01.230368 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:32:01.231881 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:32:01.233898 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:32:01.233898 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:32:01.234905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:32:01.234905 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.235410 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.235410 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:32:01.235410 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.236417 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.236417 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:32:01.237923 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:32:01.238649 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:32:01.238649 [info ] [Thread-1 (]: 38 of 47 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:32:01.238649 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:32:01.239655 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:32:01.239655 [info ] [Thread-1 (]: 39 of 47 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:32:01.239655 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:32:01.239655 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:32:01.244750 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:32:01.244750 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:32:01.246826 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:32:01.247389 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:32:01.247389 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:32:01.247389 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.248947 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.248947 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:32:01.249542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.251052 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.251655 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:32:01.252661 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:32:01.253167 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:32:01.253167 [info ] [Thread-1 (]: 39 of 47 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m06:32:01.253672 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:32:01.253672 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:32:01.253672 [info ] [Thread-1 (]: 40 of 47 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:32:01.254678 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:32:01.254678 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:32:01.257189 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:32:01.258188 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:32:01.261719 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:32:01.261719 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:32:01.261719 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:32:01.261719 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.263223 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.263223 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:32:01.264231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:32:01.265806 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.267494 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:32:01.267494 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:32:01.267494 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:32:01.269039 [info ] [Thread-1 (]: 40 of 47 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:32:01.269039 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:32:01.269039 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:32:01.269039 [info ] [Thread-1 (]: 41 of 47 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:32:01.270602 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:32:01.270602 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:32:01.273181 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:32:01.274259 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:32:01.276421 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:32:01.276421 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:32:01.277401 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:32:01.277401 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.277401 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.278400 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:32:01.278400 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.279400 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.279944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:32:01.280974 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:32:01.280974 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:32:01.280974 [info ] [Thread-1 (]: 41 of 47 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:32:01.282090 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:32:01.282090 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:32:01.282598 [info ] [Thread-1 (]: 42 of 47 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:32:01.283110 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:32:01.283110 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:32:01.286580 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:32:01.288086 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:32:01.289687 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:32:01.289687 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:32:01.291193 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:32:01.291193 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.292200 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.292200 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:32:01.292200 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.293245 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:32:01.294831 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:32:01.296386 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:32:01.296985 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:32:01.296985 [info ] [Thread-1 (]: 42 of 47 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m06:32:01.296985 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:32:01.297990 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:32:01.297990 [info ] [Thread-1 (]: 43 of 47 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:32:01.298497 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:32:01.298497 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:32:01.301099 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:32:01.301772 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:32:01.303780 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:32:01.304288 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:32:01.305295 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:32:01.305295 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.305832 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.305832 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:32:01.305832 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:32:01.306838 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.307843 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:32:01.308845 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:32:01.309845 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:32:01.309845 [info ] [Thread-1 (]: 43 of 47 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:32:01.310351 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:32:01.310940 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:32:01.310940 [info ] [Thread-1 (]: 44 of 47 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:32:01.310940 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:32:01.310940 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:32:01.314459 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:32:01.314459 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:32:01.317040 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:32:01.317040 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:32:01.318046 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:32:01.318046 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.318046 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.319046 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:32:01.319046 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.319552 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.320558 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:32:01.320558 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:32:01.320558 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:32:01.322171 [info ] [Thread-1 (]: 44 of 47 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:32:01.322171 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:32:01.322171 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:32:01.322171 [info ] [Thread-1 (]: 45 of 47 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:32:01.322171 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:32:01.322171 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:32:01.328279 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:32:01.328785 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:32:01.329820 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:32:01.331419 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:32:01.331419 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:32:01.331945 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.331945 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.331945 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:32:01.331945 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:32:01.334222 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.335439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:32:01.335439 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:32:01.336471 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:32:01.336471 [info ] [Thread-1 (]: 45 of 47 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.01s]
[0m06:32:01.336471 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:32:01.337451 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:32:01.337972 [info ] [Thread-1 (]: 46 of 47 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:32:01.337972 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:32:01.338560 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:32:01.341072 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:32:01.342079 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:32:01.343591 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:32:01.343591 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:32:01.343591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:32:01.343591 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.345280 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.345280 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:32:01.345280 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:32:01.346792 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.347483 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:32:01.348995 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:32:01.348995 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:32:01.349546 [info ] [Thread-1 (]: 46 of 47 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m06:32:01.349546 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:32:01.350551 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:32:01.351078 [info ] [Thread-1 (]: 47 of 47 START sql view model main.view_resumo_financeiro_relatorios ........... [RUN]
[0m06:32:01.351078 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios)
[0m06:32:01.351641 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:32:01.354150 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:32:01.354150 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:32:01.366400 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:32:01.367086 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:32:01.367086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: BEGIN
[0m06:32:01.367086 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:32:01.368657 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.369345 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:32:01.369345 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    
    -- Data
    t.data as data_base,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
  );

[0m06:32:01.371011 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.373530 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:32:01.373530 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */
alter view "gold_warehouse"."main"."view_resumo_financeiro_relatorios" rename to "view_resumo_financeiro_relatorios__dbt_backup"
[0m06:32:01.374536 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.376049 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:32:01.377048 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */
alter view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" rename to "view_resumo_financeiro_relatorios"
[0m06:32:01.377048 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:32:01.378048 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m06:32:01.378048 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:32:01.379048 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m06:32:01.380056 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.381619 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:32:01.382143 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_backup" cascade
    
[0m06:32:01.382143 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:32:01.383663 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: Close
[0m06:32:01.383663 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0118007a-b82f-45e0-98fd-5ff68b51b0eb', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000294348D6630>]}
[0m06:32:01.384415 [info ] [Thread-1 (]: 47 of 47 OK created sql view model main.view_resumo_financeiro_relatorios ...... [[32mOK[0m in 0.03s]
[0m06:32:01.384929 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:32:01.385442 [debug] [MainThread]: Using duckdb connection "master"
[0m06:32:01.385442 [debug] [MainThread]: On master: BEGIN
[0m06:32:01.386447 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:32:01.386447 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:32:01.386447 [debug] [MainThread]: On master: COMMIT
[0m06:32:01.386447 [debug] [MainThread]: Using duckdb connection "master"
[0m06:32:01.387463 [debug] [MainThread]: On master: COMMIT
[0m06:32:01.387463 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:32:01.387971 [debug] [MainThread]: On master: Close
[0m06:32:01.387971 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:32:01.388495 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:32:01.388495 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:32:01.388495 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' was properly closed.
[0m06:32:01.388495 [info ] [MainThread]: 
[0m06:32:01.388495 [info ] [MainThread]: Finished running 3 seeds, 7 table models, 36 data tests, 1 view model in 0 hours 0 minutes and 2.40 seconds (2.40s).
[0m06:32:01.392586 [debug] [MainThread]: Command end result
[0m06:32:01.420726 [debug] [MainThread]: Wrote artifact WritableManifest to src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:32:01.423286 [debug] [MainThread]: Wrote artifact SemanticManifest to src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:32:01.428507 [debug] [MainThread]: Wrote artifact RunExecutionResult to src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:32:01.428507 [info ] [MainThread]: 
[0m06:32:01.428507 [info ] [MainThread]: [32mCompleted successfully[0m
[0m06:32:01.429486 [info ] [MainThread]: 
[0m06:32:01.429486 [info ] [MainThread]: Done. PASS=47 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=47
[0m06:32:01.429989 [debug] [MainThread]: Command `dbt build` succeeded at 06:32:01.429989 after 3.34 seconds
[0m06:32:01.429989 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000294322D6420>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000294322D6390>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000029431C67710>]}
[0m06:32:01.430993 [debug] [MainThread]: Flushing usage events
[0m06:32:02.610603 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:33:38.893485 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA3712A360>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA37128620>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA3712B8C0>]}


============================== 06:33:38.897187 | 5fc7dfda-01ec-411d-93d1-5537ec42b8b8 ==============================
[0m06:33:38.897187 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:33:38.897187 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'indirect_selection': 'eager', 'use_colors': 'True', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:33:39.077942 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA38B9C080>]}
[0m06:33:39.125254 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA379A6570>]}
[0m06:33:39.127120 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:33:39.348753 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:33:39.480094 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed.
[0m06:33:39.480094 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m06:33:39.481124 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_capital_prudencial.sql
[0m06:33:39.481124 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_indexador.sql
[0m06:33:39.481124 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_carteira_credito_totais.sql
[0m06:33:39.482205 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m06:33:39.482205 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_movimentacao_cambio.sql
[0m06:33:39.482205 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_operacoes_clientes.sql
[0m06:33:39.483232 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_resumo_financeiro.sql
[0m06:33:39.483232 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\dim_instituicao.sql
[0m06:33:39.859684 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m06:33:39.860212 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA392B89E0>]}
[0m06:33:40.020649 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:33:40.029789 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA38FBA510>]}
[0m06:33:40.100999 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:33:40.103730 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:33:40.151740 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA38FEC950>]}
[0m06:33:40.151740 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:33:40.155773 [info ] [MainThread]: 
[0m06:33:40.157084 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:33:40.157084 [info ] [MainThread]: 
[0m06:33:40.157084 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:33:40.159589 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:33:40.221856 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:33:40.221856 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:33:40.223525 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:33:40.327503 [debug] [ThreadPool]: SQL status: OK in 0.104 seconds
[0m06:33:40.327503 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:33:40.328604 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:33:40.329505 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:33:40.333868 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:33:40.333868 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:33:40.333868 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:33:40.334875 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:33:40.335380 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:33:40.335380 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:33:40.336387 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:33:40.336387 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:33:40.336387 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:33:40.336387 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:33:40.336387 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:33:40.338353 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:33:40.338353 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:33:40.338353 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:33:40.338353 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:33:40.341086 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:33:40.345118 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:33:40.345118 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:33:40.345118 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:33:40.346126 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:33:40.346679 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:33:40.346679 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:33:40.356414 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m06:33:40.357398 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:33:40.358398 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:33:40.358398 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:33:40.361798 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA38FBB890>]}
[0m06:33:40.361798 [debug] [MainThread]: Using duckdb connection "master"
[0m06:33:40.361798 [debug] [MainThread]: On master: BEGIN
[0m06:33:40.361798 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:33:40.363321 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:33:40.363321 [debug] [MainThread]: On master: COMMIT
[0m06:33:40.363321 [debug] [MainThread]: Using duckdb connection "master"
[0m06:33:40.363321 [debug] [MainThread]: On master: COMMIT
[0m06:33:40.364414 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:33:40.364414 [debug] [MainThread]: On master: Close
[0m06:33:40.367750 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:33:40.369279 [info ] [Thread-1 (]: 1 of 47 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:33:40.369279 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:33:40.369279 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:33:40.382366 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.382366 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:33:40.402964 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.404469 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.404469 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:33:40.404469 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:33:40.406015 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:40.406015 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.406015 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:33:40.885453 [debug] [Thread-1 (]: SQL status: OK in 0.478 seconds
[0m06:33:40.889165 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.889165 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:33:40.890178 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:40.891181 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.891181 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:33:40.892461 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:40.896678 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.896678 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:33:40.897317 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:40.899617 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.899617 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:33:40.899617 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:40.910688 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:33:40.911701 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.911701 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:33:40.927572 [debug] [Thread-1 (]: SQL status: OK in 0.016 seconds
[0m06:33:40.932113 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:33:40.932113 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:33:40.933644 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:40.936618 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:33:40.938170 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA392A5580>]}
[0m06:33:40.938877 [info ] [Thread-1 (]: 1 of 47 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.57s]
[0m06:33:40.938877 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:33:40.939900 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:33:40.939900 [info ] [Thread-1 (]: 2 of 47 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:33:40.941556 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:33:40.942162 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:33:40.946297 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:40.946937 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:33:40.952656 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:40.954307 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:40.954307 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:33:40.954307 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:40.955820 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:40.955820 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:40.956889 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:33:41.008679 [debug] [Thread-1 (]: SQL status: OK in 0.052 seconds
[0m06:33:41.010256 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:41.010863 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:33:41.010863 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.011899 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:41.011899 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:33:41.013407 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.015521 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:41.015521 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m06:33:41.015521 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.018091 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:41.018091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:33:41.018616 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.019178 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:33:41.019178 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:41.019178 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:33:41.021795 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:33:41.023372 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:33:41.023372 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:33:41.024914 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.025543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:33:41.026559 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA397DB470>]}
[0m06:33:41.026559 [info ] [Thread-1 (]: 2 of 47 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.09s]
[0m06:33:41.027569 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:33:41.027569 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:33:41.027569 [info ] [Thread-1 (]: 3 of 47 START sql table model main.dim_tempo ................................... [RUN]
[0m06:33:41.027569 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:33:41.029095 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:33:41.036476 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.037487 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:33:41.040186 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.041229 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.041746 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:33:41.041746 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.042257 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.042257 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.042257 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:33:41.099206 [debug] [Thread-1 (]: SQL status: OK in 0.056 seconds
[0m06:33:41.099912 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.099912 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:33:41.100946 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.101475 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.102509 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:33:41.102509 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.104034 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.105686 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:33:41.105686 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.108244 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.108244 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:33:41.108244 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.109804 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:33:41.109804 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.109804 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:33:41.111285 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.113409 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:33:41.113409 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:33:41.114551 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.115674 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:33:41.116290 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA397DB0E0>]}
[0m06:33:41.116290 [info ] [Thread-1 (]: 3 of 47 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.09s]
[0m06:33:41.117078 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:33:41.117078 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:33:41.117078 [info ] [Thread-1 (]: 4 of 47 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m06:33:41.117078 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:33:41.118655 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:33:41.121051 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.122770 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:33:41.125249 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.125249 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.126255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:33:41.126255 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.126255 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.127255 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.127255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:33:41.376560 [debug] [Thread-1 (]: SQL status: OK in 0.249 seconds
[0m06:33:41.377507 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.377507 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:33:41.379115 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.380094 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.380094 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:33:41.381101 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.383350 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.383854 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m06:33:41.383854 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.386369 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.386369 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:33:41.386369 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.387875 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:33:41.387875 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.388524 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:33:41.551572 [debug] [Thread-1 (]: SQL status: OK in 0.163 seconds
[0m06:33:41.554085 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:33:41.554085 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:33:41.555636 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.556753 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:33:41.557765 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA3976A990>]}
[0m06:33:41.557765 [info ] [Thread-1 (]: 4 of 47 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.44s]
[0m06:33:41.558765 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:33:41.558765 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:33:41.558765 [info ] [Thread-1 (]: 5 of 47 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m06:33:41.558765 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:33:41.560104 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:33:41.560104 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:33:41.576808 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:33:41.577814 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:33:41.577814 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.577814 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.577814 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:33:41.577814 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m06:33:41.579417 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.586524 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:33:41.586524 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:33:41.587549 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:33:41.588220 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:33:41.588220 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: ROLLBACK
[0m06:33:41.591913 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_consolidado'
[0m06:33:41.591913 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:33:41.593469 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv"
[0m06:33:41.595156 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA3990C830>]}
[0m06:33:41.595156 [error] [Thread-1 (]: 5 of 47 ERROR loading seed file main.seed_dim_consolidado ...................... [[31mERROR[0m in 0.04s]
[0m06:33:41.595156 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:33:41.596312 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:33:41.596312 [info ] [Thread-1 (]: 6 of 47 START seed file main.seed_dim_controle ................................. [RUN]
[0m06:33:41.596827 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:33:41.596827 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:33:41.597425 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:33:41.599592 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_consolidado' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv".
[0m06:33:41.601807 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:33:41.602813 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:33:41.602813 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.603812 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.603812 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:33:41.603812 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m06:33:41.603812 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.605404 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:33:41.605404 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:33:41.606918 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:33:41.606918 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:33:41.607926 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: ROLLBACK
[0m06:33:41.609923 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_controle'
[0m06:33:41.610426 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:33:41.611960 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv"
[0m06:33:41.612960 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA397D7980>]}
[0m06:33:41.612960 [error] [Thread-1 (]: 6 of 47 ERROR loading seed file main.seed_dim_controle ......................... [[31mERROR[0m in 0.02s]
[0m06:33:41.612960 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:33:41.614739 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:33:41.615649 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_controle' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv".
[0m06:33:41.615142 [info ] [Thread-1 (]: 7 of 47 START seed file main.seed_dim_segmento ................................. [RUN]
[0m06:33:41.616153 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:33:41.616765 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:33:41.616765 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:33:41.620964 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:33:41.620964 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:33:41.620964 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.621976 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.621976 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:33:41.621976 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m06:33:41.621976 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.623610 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:33:41.623610 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:33:41.624152 [debug] [Thread-1 (]: DuckDB adapter: Error running SQL: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        
[0m06:33:41.624827 [debug] [Thread-1 (]: DuckDB adapter: Rolling back transaction.
[0m06:33:41.624827 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: ROLLBACK
[0m06:33:41.626535 [debug] [Thread-1 (]: Failed to rollback 'seed.bacen_ifdata_analytics.seed_dim_segmento'
[0m06:33:41.627535 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:33:41.629465 [debug] [Thread-1 (]: Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv"
[0m06:33:41.630554 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5fc7dfda-01ec-411d-93d1-5537ec42b8b8', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA398B2EA0>]}
[0m06:33:41.631121 [error] [Thread-1 (]: 7 of 47 ERROR loading seed file main.seed_dim_segmento ......................... [[31mERROR[0m in 0.01s]
[0m06:33:41.631121 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:33:41.631121 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:33:41.632126 [info ] [Thread-1 (]: 8 of 47 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:33:41.632629 [debug] [Thread-4 (]: Marking all children of 'seed.bacen_ifdata_analytics.seed_dim_segmento' to be skipped because of status 'error'.  Reason: Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv".
[0m06:33:41.632629 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:33:41.633132 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:33:41.638450 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:33:41.639483 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:33:41.654008 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:33:41.655656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:33:41.655656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:33:41.656662 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.656662 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.656662 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:33:41.656662 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.658169 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.660680 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:33:41.661686 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:33:41.661686 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:33:41.661686 [info ] [Thread-1 (]: 8 of 47 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m06:33:41.661686 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:33:41.663191 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:33:41.663191 [info ] [Thread-1 (]: 9 of 47 START test not_null_dim_instituicao_id_localizacao ..................... [RUN]
[0m06:33:41.663191 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:33:41.663191 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:33:41.668576 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:33:41.670093 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:33:41.673116 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:33:41.675610 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:33:41.675610 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:33:41.676614 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.677615 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.677615 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:33:41.678618 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.679716 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.681844 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:33:41.681844 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:33:41.682850 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:33:41.682850 [info ] [Thread-1 (]: 9 of 47 PASS not_null_dim_instituicao_id_localizacao ........................... [[32mPASS[0m in 0.02s]
[0m06:33:41.682850 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:33:41.684324 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:33:41.684960 [info ] [Thread-1 (]: 10 of 47 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:33:41.684960 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:33:41.685544 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:33:41.688558 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:33:41.689202 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:33:41.691208 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:33:41.692572 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:33:41.692572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:33:41.692572 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.693578 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.693578 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:33:41.693578 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.695231 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.696759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:33:41.697795 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:33:41.697795 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:33:41.697795 [info ] [Thread-1 (]: 10 of 47 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:33:41.698800 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:33:41.699315 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:33:41.699315 [info ] [Thread-1 (]: 11 of 47 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:33:41.699922 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:33:41.699922 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:33:41.703954 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:33:41.705462 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:33:41.706470 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:33:41.707468 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:33:41.708469 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:33:41.708469 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.709469 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.709469 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:33:41.709974 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.715529 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:33:41.716134 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:33:41.717248 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:33:41.717862 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:33:41.717862 [info ] [Thread-1 (]: 11 of 47 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:33:41.718865 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:33:41.718865 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:33:41.719872 [info ] [Thread-1 (]: 12 of 47 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:33:41.719872 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:33:41.719872 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:33:41.724502 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:33:41.725383 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:33:41.727393 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:33:41.729538 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:33:41.729538 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:33:41.729538 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.730668 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.730668 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:33:41.731213 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.736680 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:33:41.737763 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:33:41.738384 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:33:41.738384 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:33:41.739389 [info ] [Thread-1 (]: 12 of 47 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:33:41.739389 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:33:41.739389 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:33:41.741634 [info ] [Thread-1 (]: 13 of 47 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:33:41.742141 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:33:41.742141 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:33:41.746627 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:33:41.747388 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:33:41.750167 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:33:41.751704 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:33:41.751704 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:33:41.751704 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.752851 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.752851 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:33:41.752851 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.756929 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:33:41.757937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:33:41.758930 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:33:41.758930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:33:41.758930 [info ] [Thread-1 (]: 13 of 47 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:33:41.759882 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:33:41.760391 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:33:41.760391 [info ] [Thread-1 (]: 14 of 47 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:33:41.761100 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:33:41.761100 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:33:41.764585 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:33:41.765590 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:33:41.767015 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:33:41.768021 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:33:41.768021 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:33:41.769020 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.769527 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.769527 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:33:41.771036 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.775432 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:33:41.776439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:33:41.777444 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:33:41.778445 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:33:41.778445 [info ] [Thread-1 (]: 14 of 47 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:33:41.779444 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:33:41.779444 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:33:41.780117 [info ] [Thread-1 (]: 15 of 47 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:33:41.780117 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:33:41.780117 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:33:41.783844 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:33:41.785474 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:33:41.786479 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:33:41.788099 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:33:41.788099 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:33:41.788771 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.788771 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.788771 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:33:41.789792 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.793447 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:33:41.795181 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:33:41.796728 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:33:41.796728 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:33:41.797089 [info ] [Thread-1 (]: 15 of 47 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:33:41.797612 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:33:41.797612 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:33:41.798624 [info ] [Thread-1 (]: 16 of 47 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:33:41.798624 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:33:41.799238 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:33:41.801613 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:33:41.803160 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:33:41.804172 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:33:41.805275 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:33:41.805958 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:33:41.805958 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.805958 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.806962 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:33:41.806962 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.807961 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:33:41.810013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:33:41.810730 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:33:41.810730 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:33:41.810730 [info ] [Thread-1 (]: 16 of 47 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:33:41.811759 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:33:41.811759 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:33:41.811759 [info ] [Thread-1 (]: 17 of 47 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:33:41.811759 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:33:41.811759 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:33:41.816350 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:33:41.817357 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:33:41.818867 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:33:41.819874 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:33:41.819874 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:33:41.820380 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.820884 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.820884 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:33:41.820884 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.824770 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:33:41.825764 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:33:41.826564 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:33:41.826564 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:33:41.827562 [info ] [Thread-1 (]: 17 of 47 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:33:41.827562 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:33:41.827562 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:33:41.828568 [info ] [Thread-1 (]: 18 of 47 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:33:41.828568 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:33:41.828568 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:33:41.834564 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:33:41.835185 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:33:41.884551 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:33:41.885153 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:33:41.886160 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:33:41.886160 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.886160 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.887762 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:33:41.887762 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:33:41.889413 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:33:41.891013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:33:41.892629 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:33:41.892629 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:33:41.892629 [info ] [Thread-1 (]: 18 of 47 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.06s]
[0m06:33:41.893840 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:33:41.893840 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:33:41.893840 [info ] [Thread-1 (]: 19 of 47 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:33:41.894845 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:33:41.894845 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:33:41.897142 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:33:41.898727 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:33:41.901403 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:33:41.901403 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:33:41.902913 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:33:41.902913 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.903922 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.903922 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:33:41.904429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.905435 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.906448 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:33:41.907442 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:33:41.907442 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:33:41.907442 [info ] [Thread-1 (]: 19 of 47 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:33:41.908945 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:33:41.908945 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:33:41.908945 [info ] [Thread-1 (]: 20 of 47 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:33:41.909951 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:33:41.909951 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:33:41.913167 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:33:41.913167 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:33:41.915823 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:33:41.916627 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:33:41.916627 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:33:41.916627 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.916627 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.918179 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:33:41.918179 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.919185 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.919185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:33:41.920956 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:33:41.920956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:33:41.922055 [info ] [Thread-1 (]: 20 of 47 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.01s]
[0m06:33:41.922055 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:33:41.922055 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:33:41.922055 [info ] [Thread-1 (]: 21 of 47 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:33:41.922055 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:33:41.923787 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:33:41.926293 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:33:41.928297 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:33:41.929806 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:33:41.930760 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:33:41.930760 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:33:41.931265 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.931928 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.931928 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:33:41.931928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:33:41.933540 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.934610 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:33:41.935710 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:33:41.935710 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:33:41.936319 [info ] [Thread-1 (]: 21 of 47 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.01s]
[0m06:33:41.936319 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:33:41.936319 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:33:41.936319 [info ] [Thread-1 (]: 22 of 47 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:33:41.936319 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:33:41.937823 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:33:41.941142 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:33:41.942148 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:33:41.943711 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:33:41.943711 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:33:41.943711 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:33:41.943711 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.945499 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.945499 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:33:41.945499 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.946164 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.947305 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:33:41.947942 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:33:41.947942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:33:41.949006 [info ] [Thread-1 (]: 22 of 47 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m06:33:41.949416 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:33:41.949416 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:33:41.950037 [info ] [Thread-1 (]: 23 of 47 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:33:41.950037 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:33:41.950561 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:33:41.953970 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:33:41.953970 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:33:41.957003 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:33:41.958018 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:33:41.958018 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:33:41.959007 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.959007 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.959007 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:33:41.959007 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.962579 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:33:41.964054 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:33:41.964559 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:33:41.964559 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:33:41.965565 [info ] [Thread-1 (]: 23 of 47 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:33:41.966069 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:33:41.966069 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:33:41.966850 [info ] [Thread-1 (]: 24 of 47 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:33:41.966850 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:33:41.966850 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:33:41.970554 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:33:41.971098 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:33:41.973121 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:33:41.974128 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:33:41.974633 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:33:41.975138 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.975138 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:41.975138 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:33:41.976144 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.977655 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:33:41.979161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:33:41.980168 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:33:41.980673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:33:41.981178 [info ] [Thread-1 (]: 24 of 47 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:33:41.981178 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:33:41.981694 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:33:41.982207 [info ] [Thread-1 (]: 25 of 47 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:33:41.982207 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:33:41.982207 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:33:41.985962 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:33:41.987467 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:33:41.989341 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:33:41.989341 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:33:41.990845 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:33:41.990845 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:41.990845 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:41.990845 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:33:41.991964 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:41.994053 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:33:41.994053 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:33:41.995174 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:33:41.995174 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:33:41.996289 [info ] [Thread-1 (]: 25 of 47 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:33:41.996670 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:33:41.997174 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:33:41.997174 [info ] [Thread-1 (]: 26 of 47 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:33:41.997683 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:33:41.997683 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:33:42.001419 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:33:42.002431 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:33:42.002431 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:33:42.004401 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:33:42.005405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:33:42.005405 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.005405 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.005405 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:33:42.006514 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:42.008513 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:33:42.008513 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:33:42.010610 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:33:42.010610 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:33:42.010610 [info ] [Thread-1 (]: 26 of 47 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:33:42.011638 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:33:42.011638 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:33:42.011638 [info ] [Thread-1 (]: 27 of 47 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:33:42.012621 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:33:42.013127 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:33:42.016596 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:33:42.016596 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:33:42.020619 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:33:42.020619 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:33:42.020619 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:33:42.020619 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.022219 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.022750 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:33:42.022750 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:42.025272 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:33:42.027278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:33:42.027278 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:33:42.028278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:33:42.028278 [info ] [Thread-1 (]: 27 of 47 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:33:42.029277 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:33:42.029277 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:33:42.029781 [info ] [Thread-1 (]: 28 of 47 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:33:42.029781 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:33:42.029781 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:33:42.033592 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:33:42.034951 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:33:42.036592 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:33:42.037546 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:33:42.037546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:33:42.038049 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.038688 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.038688 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:33:42.038688 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:42.039790 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:42.040787 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:33:42.040787 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:33:42.040787 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:33:42.042675 [info ] [Thread-1 (]: 28 of 47 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:33:42.043188 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:33:42.043188 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:33:42.043803 [info ] [Thread-1 (]: 29 of 47 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:33:42.043803 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:33:42.043803 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:33:42.047258 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:33:42.047258 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:33:42.049641 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:33:42.051152 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:33:42.051152 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:33:42.051152 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.051973 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.051973 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:33:42.051973 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:42.054719 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:33:42.055720 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:33:42.056342 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:33:42.056342 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:33:42.056342 [info ] [Thread-1 (]: 29 of 47 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:33:42.057422 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:33:42.057422 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:33:42.058349 [info ] [Thread-1 (]: 30 of 47 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:33:42.058349 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:33:42.058349 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:33:42.061503 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:33:42.061503 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:33:42.064016 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:33:42.064829 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:33:42.064829 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:33:42.065527 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.066031 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:42.066031 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:33:42.066536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:33:42.067369 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:42.069004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:33:42.069376 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:33:42.070011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:33:42.070011 [info ] [Thread-1 (]: 30 of 47 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m06:33:42.070011 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:33:42.071011 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:33:42.071011 [info ] [Thread-1 (]: 31 of 47 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:33:42.071516 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:33:42.072021 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:33:42.074280 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:33:42.075298 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:33:42.077324 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:33:42.077324 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:33:42.078325 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:33:42.078325 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.078325 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.078325 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:33:42.079325 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:33:42.079831 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.080838 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:33:42.081343 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:33:42.082348 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:33:42.082348 [info ] [Thread-1 (]: 31 of 47 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:33:42.082348 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:33:42.083418 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:33:42.083418 [info ] [Thread-1 (]: 32 of 47 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:33:42.083973 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:33:42.083973 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:33:42.088018 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:33:42.088964 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:33:42.090074 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:33:42.091067 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:33:42.091571 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:33:42.091571 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.092184 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.092184 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:33:42.092184 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:33:42.093288 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:33:42.093288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:33:42.095063 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:33:42.095063 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:33:42.096097 [info ] [Thread-1 (]: 32 of 47 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:33:42.096097 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:33:42.097192 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:33:42.099143 [info ] [Thread-1 (]: 33 of 47 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:33:42.099686 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:33:42.099686 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:33:42.103560 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:33:42.104093 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:33:42.105624 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:33:42.105624 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:33:42.107158 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:33:42.107158 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.107158 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.108161 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:33:42.108161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:42.110520 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:33:42.111543 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:33:42.111543 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:33:42.111543 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:33:42.113050 [info ] [Thread-1 (]: 33 of 47 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:33:42.113050 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:33:42.113050 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:33:42.113050 [info ] [Thread-1 (]: 34 of 47 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:33:42.114695 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:33:42.114695 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:33:42.118012 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:33:42.119012 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:33:42.120395 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:33:42.120917 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:33:42.120917 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:33:42.121928 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:33:42.122457 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:33:42.122457 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:33:42.122978 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:33:42.127074 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:33:42.128068 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:33:42.128068 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:33:42.129590 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:33:42.129590 [info ] [Thread-1 (]: 34 of 47 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:33:42.129590 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:33:42.129590 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:33:42.131375 [info ] [Thread-1 (]: 35 of 47 SKIP relation main.dim_consolidado .................................... [[33mSKIP[0m]
[0m06:33:42.131375 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:33:42.131951 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:33:42.131951 [info ] [Thread-1 (]: 36 of 47 SKIP relation main.dim_controle ....................................... [[33mSKIP[0m]
[0m06:33:42.131951 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_consolidado' to be skipped because of status 'skipped'. 
[0m06:33:42.132958 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:33:42.133463 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:33:42.133463 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_controle' to be skipped because of status 'skipped'. 
[0m06:33:42.134056 [info ] [Thread-1 (]: 37 of 47 SKIP relation main.dim_segmento ....................................... [[33mSKIP[0m]
[0m06:33:42.134708 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:33:42.135242 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:33:42.135242 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.dim_segmento' to be skipped because of status 'skipped'. 
[0m06:33:42.135242 [info ] [Thread-1 (]: 38 of 47 SKIP test not_null_dim_consolidado_id_consolidado ..................... [[33mSKIP[0m]
[0m06:33:42.136247 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:33:42.136247 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:33:42.136247 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340' to be skipped because of status 'skipped'. 
[0m06:33:42.136247 [info ] [Thread-1 (]: 39 of 47 SKIP test not_null_dim_controle_id_controle ........................... [[33mSKIP[0m]
[0m06:33:42.136247 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:33:42.137942 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:33:42.138552 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21' to be skipped because of status 'skipped'. 
[0m06:33:42.138552 [info ] [Thread-1 (]: 40 of 47 SKIP test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[33mSKIP[0m]
[0m06:33:42.138552 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:33:42.140064 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:33:42.140064 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e' to be skipped because of status 'skipped'. 
[0m06:33:42.140064 [info ] [Thread-1 (]: 41 of 47 SKIP test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[33mSKIP[0m]
[0m06:33:42.141068 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:33:42.141068 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:33:42.141068 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f' to be skipped because of status 'skipped'. 
[0m06:33:42.141068 [info ] [Thread-1 (]: 42 of 47 SKIP test unique_dim_consolidado_id_consolidado ....................... [[33mSKIP[0m]
[0m06:33:42.142361 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:33:42.142361 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:33:42.142361 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862' to be skipped because of status 'skipped'. 
[0m06:33:42.143398 [info ] [Thread-1 (]: 43 of 47 SKIP test unique_dim_controle_id_controle ............................. [[33mSKIP[0m]
[0m06:33:42.143398 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:33:42.143398 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:33:42.143398 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c' to be skipped because of status 'skipped'. 
[0m06:33:42.143398 [info ] [Thread-1 (]: 44 of 47 SKIP test not_null_dim_segmento_id_segmento ........................... [[33mSKIP[0m]
[0m06:33:42.144954 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:33:42.144954 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:33:42.144954 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e' to be skipped because of status 'skipped'. 
[0m06:33:42.144954 [info ] [Thread-1 (]: 45 of 47 SKIP test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[33mSKIP[0m]
[0m06:33:42.144954 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:33:42.144954 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:33:42.144954 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e' to be skipped because of status 'skipped'. 
[0m06:33:42.147536 [info ] [Thread-1 (]: 46 of 47 SKIP test unique_dim_segmento_id_segmento ............................. [[33mSKIP[0m]
[0m06:33:42.147536 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:33:42.147536 [debug] [Thread-4 (]: Marking all children of 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a' to be skipped because of status 'skipped'. 
[0m06:33:42.148561 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:33:42.148561 [info ] [Thread-1 (]: 47 of 47 SKIP relation main.view_resumo_financeiro_relatorios .................. [[33mSKIP[0m]
[0m06:33:42.149153 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:33:42.149153 [debug] [Thread-4 (]: Marking all children of 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' to be skipped because of status 'skipped'. 
[0m06:33:42.149823 [debug] [MainThread]: Using duckdb connection "master"
[0m06:33:42.150839 [debug] [MainThread]: On master: BEGIN
[0m06:33:42.150839 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:33:42.151344 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:33:42.151344 [debug] [MainThread]: On master: COMMIT
[0m06:33:42.151344 [debug] [MainThread]: Using duckdb connection "master"
[0m06:33:42.151344 [debug] [MainThread]: On master: COMMIT
[0m06:33:42.152350 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:33:42.152350 [debug] [MainThread]: On master: Close
[0m06:33:42.152350 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:33:42.152350 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:33:42.152350 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:33:42.152350 [debug] [MainThread]: Connection 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a' was properly closed.
[0m06:33:42.152350 [info ] [MainThread]: 
[0m06:33:42.153856 [info ] [MainThread]: Finished running 3 seeds, 7 table models, 36 data tests, 1 view model in 0 hours 0 minutes and 2.00 seconds (2.00s).
[0m06:33:42.156375 [debug] [MainThread]: Command end result
[0m06:33:42.184410 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:33:42.186931 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:33:42.192261 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:33:42.192261 [info ] [MainThread]: 
[0m06:33:42.193278 [info ] [MainThread]: [31mCompleted with 3 errors, 0 partial successes, and 0 warnings:[0m
[0m06:33:42.193278 [info ] [MainThread]: 
[0m06:33:42.193785 [error] [MainThread]: [31mFailure in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)[0m
[0m06:33:42.193785 [error] [MainThread]:   Runtime Error in seed seed_dim_consolidado (seeds\seed_dim_consolidado.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv"
[0m06:33:42.193785 [info ] [MainThread]: 
[0m06:33:42.193785 [error] [MainThread]: [31mFailure in seed seed_dim_controle (seeds\seed_dim_controle.csv)[0m
[0m06:33:42.194790 [error] [MainThread]:   Runtime Error in seed seed_dim_controle (seeds\seed_dim_controle.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv"
[0m06:33:42.194790 [info ] [MainThread]: 
[0m06:33:42.194790 [error] [MainThread]: [31mFailure in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)[0m
[0m06:33:42.194790 [error] [MainThread]:   Runtime Error in seed seed_dim_segmento (seeds\seed_dim_segmento.csv)
  IO Error: No files found that match the pattern "src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv"
[0m06:33:42.194790 [info ] [MainThread]: 
[0m06:33:42.194790 [info ] [MainThread]: Done. PASS=31 WARN=0 ERROR=3 SKIP=13 NO-OP=0 TOTAL=47
[0m06:33:42.196321 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 21 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:33:42.196878 [debug] [MainThread]: Command `dbt build` failed at 06:33:42.196878 after 3.48 seconds
[0m06:33:42.196878 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA375E6510>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA375E5520>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001DA3761B140>]}
[0m06:33:42.196878 [debug] [MainThread]: Flushing usage events
[0m06:33:43.105304 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:34:04.182018 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002237FD7CC50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022303B12210>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000223040E77A0>]}


============================== 06:34:04.185551 | 6c9a5356-0cd4-4fb2-b534-a18123078e82 ==============================
[0m06:34:04.185551 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:34:04.186574 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'src/bacen_ifdata/data_analytics', 'indirect_selection': 'eager', 'use_colors': 'True', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios --project-dir src/bacen_ifdata/data_analytics --profiles-dir src/bacen_ifdata/data_analytics', 'use_experimental_parser': 'False', 'log_path': 'src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:34:04.386209 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000223062581A0>]}
[0m06:34:04.437864 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022304C0A6F0>]}
[0m06:34:04.439541 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:34:04.664175 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:34:04.812927 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
[0m06:34:04.814511 [debug] [MainThread]: Nothing changed, skipping partial parsing.
[0m06:34:04.814511 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing
[0m06:34:04.819197 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:34:04.855631 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022306202960>]}
[0m06:34:04.931911 [debug] [MainThread]: Wrote artifact WritableManifest to src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:34:04.933915 [debug] [MainThread]: Wrote artifact SemanticManifest to src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:34:05.023149 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000223066A7740>]}
[0m06:34:05.024207 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:34:05.029090 [info ] [MainThread]: 
[0m06:34:05.029637 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:34:05.029637 [info ] [MainThread]: 
[0m06:34:05.029637 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:34:05.035042 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:34:05.095094 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:34:05.095094 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:34:05.095094 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:34:05.237933 [debug] [ThreadPool]: SQL status: OK in 0.142 seconds
[0m06:34:05.238940 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:34:05.239858 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:34:05.239858 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:34:05.245174 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:34:05.245174 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:34:05.245174 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:34:05.246282 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:34:05.246829 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:34:05.247463 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:34:05.247463 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:34:05.247463 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:34:05.247463 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:34:05.247463 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:34:05.249161 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:34:05.249161 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:34:05.249495 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:34:05.249495 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:34:05.250009 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:34:05.252279 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:34:05.255948 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:34:05.256958 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:34:05.256958 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:34:05.256958 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:34:05.257957 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:34:05.257957 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:34:05.267309 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m06:34:05.268827 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:34:05.270834 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:34:05.271841 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:34:05.275654 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002230681BB90>]}
[0m06:34:05.276708 [debug] [MainThread]: Using duckdb connection "master"
[0m06:34:05.276708 [debug] [MainThread]: On master: BEGIN
[0m06:34:05.276708 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:34:05.276708 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:34:05.277725 [debug] [MainThread]: On master: COMMIT
[0m06:34:05.277725 [debug] [MainThread]: Using duckdb connection "master"
[0m06:34:05.277725 [debug] [MainThread]: On master: COMMIT
[0m06:34:05.277725 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:34:05.277725 [debug] [MainThread]: On master: Close
[0m06:34:05.281061 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:34:05.282184 [info ] [Thread-1 (]: 1 of 47 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:34:05.282184 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:34:05.282184 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:34:05.295230 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.296842 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:34:05.316793 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.317939 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.318925 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:34:05.318925 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:34:05.319949 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:05.319949 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.320453 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:34:05.769156 [debug] [Thread-1 (]: SQL status: OK in 0.448 seconds
[0m06:34:05.772440 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.773470 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:34:05.774001 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.775043 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.775043 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:34:05.776061 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.780139 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.780139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:34:05.780139 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.783411 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.783956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:34:05.783956 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.793308 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:34:05.794512 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.794512 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:34:05.805538 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:34:05.809565 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:05.809565 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:34:05.810987 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:05.811992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:34:05.814507 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000223062294C0>]}
[0m06:34:05.814507 [info ] [Thread-1 (]: 1 of 47 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.53s]
[0m06:34:05.815959 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:34:05.815959 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:34:05.816495 [info ] [Thread-1 (]: 2 of 47 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:34:05.817285 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:34:05.817788 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:34:05.819841 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.820837 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:34:05.823463 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.823463 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.823463 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:34:05.823463 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:05.825389 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.825389 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.825389 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:34:05.855630 [debug] [Thread-1 (]: SQL status: OK in 0.030 seconds
[0m06:34:05.856654 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.856654 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:34:05.857652 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.858818 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.858818 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:34:05.859818 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.862044 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.862044 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m06:34:05.862044 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.865052 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.865052 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:34:05.865563 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.866568 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:34:05.867074 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.867074 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:34:05.869078 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:05.870964 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:05.870964 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:34:05.872469 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:05.873566 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:34:05.873566 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022306C4ED20>]}
[0m06:34:05.874572 [info ] [Thread-1 (]: 2 of 47 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.06s]
[0m06:34:05.875076 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:34:05.875076 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:34:05.875076 [info ] [Thread-1 (]: 3 of 47 START sql table model main.dim_tempo ................................... [RUN]
[0m06:34:05.876081 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:34:05.876081 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:34:05.883531 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.884903 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:34:05.888129 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.888926 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.889441 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:34:05.889441 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:05.889441 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.890447 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.890447 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:34:05.955487 [debug] [Thread-1 (]: SQL status: OK in 0.064 seconds
[0m06:34:05.956495 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.956495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:34:05.957501 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.958501 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.958501 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:34:05.958501 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.961661 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.961661 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:34:05.961661 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.964216 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.964216 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:34:05.965297 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.965843 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:34:05.965843 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.966446 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:34:05.968056 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:05.970221 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:05.970744 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:34:05.971756 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:05.971756 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:34:05.971756 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022306B967B0>]}
[0m06:34:05.973303 [info ] [Thread-1 (]: 3 of 47 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m06:34:05.973303 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:34:05.973303 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:34:05.973303 [info ] [Thread-1 (]: 4 of 47 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m06:34:05.975046 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:34:05.975046 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:34:05.979555 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:05.979555 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:34:05.982909 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:05.983509 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:05.984091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:34:05.984091 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:05.984751 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:05.984751 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:05.985351 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:34:06.241139 [debug] [Thread-1 (]: SQL status: OK in 0.255 seconds
[0m06:34:06.242145 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:06.242145 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:34:06.242145 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.243600 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:06.243600 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m06:34:06.245113 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.247266 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:06.247266 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m06:34:06.248780 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.251530 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:06.251530 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:34:06.252537 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.254042 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:34:06.254042 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:06.254042 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:34:06.433348 [debug] [Thread-1 (]: SQL status: OK in 0.178 seconds
[0m06:34:06.436424 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:06.436424 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:34:06.438511 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.439635 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:34:06.439635 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022306D74830>]}
[0m06:34:06.439635 [info ] [Thread-1 (]: 4 of 47 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.46s]
[0m06:34:06.441140 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:34:06.441140 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:34:06.441140 [info ] [Thread-1 (]: 5 of 47 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m06:34:06.442146 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:34:06.442146 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:34:06.442146 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:34:06.458401 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:06.458401 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:34:06.458401 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.459907 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.459907 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:06.459907 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m06:34:06.460959 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.467880 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:06.467880 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:06.470629 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.475037 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:06.477110 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:34:06.477110 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:06.477110 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:34:06.479688 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.479688 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:34:06.479688 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022306D74DA0>]}
[0m06:34:06.481321 [info ] [Thread-1 (]: 5 of 47 OK loaded seed file main.seed_dim_consolidado .......................... [[32mINSERT 8[0m in 0.04s]
[0m06:34:06.481321 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:34:06.482124 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:34:06.482124 [info ] [Thread-1 (]: 6 of 47 START seed file main.seed_dim_controle ................................. [RUN]
[0m06:34:06.482124 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:34:06.483130 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:34:06.483635 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:34:06.487483 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:06.488096 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:34:06.488096 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.488714 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.488714 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:06.488714 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m06:34:06.489720 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.489720 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:06.489720 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:06.492292 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.492292 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:06.493803 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:34:06.493803 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:06.494809 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:34:06.494809 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.496491 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:34:06.496491 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022306336000>]}
[0m06:34:06.497246 [info ] [Thread-1 (]: 6 of 47 OK loaded seed file main.seed_dim_controle ............................. [[32mINSERT 3[0m in 0.01s]
[0m06:34:06.497246 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:34:06.497246 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:34:06.497246 [info ] [Thread-1 (]: 7 of 47 START seed file main.seed_dim_segmento ................................. [RUN]
[0m06:34:06.497246 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:34:06.498911 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:34:06.498911 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:34:06.502679 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:06.502679 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:34:06.503683 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.503683 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.503683 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:06.504692 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m06:34:06.504692 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.505697 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:06.505697 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:06.507709 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.507709 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:06.508827 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:34:06.509821 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:06.510325 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:34:06.510919 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.512474 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:34:06.512474 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002232776FE00>]}
[0m06:34:06.513005 [info ] [Thread-1 (]: 7 of 47 OK loaded seed file main.seed_dim_segmento ............................. [[32mINSERT 5[0m in 0.02s]
[0m06:34:06.513005 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:34:06.513005 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:34:06.514681 [info ] [Thread-1 (]: 8 of 47 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:34:06.514681 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:34:06.515237 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:34:06.523366 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:34:06.523366 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:34:06.535680 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:34:06.536711 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:34:06.536711 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:34:06.536711 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.537708 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.538216 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:34:06.538216 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.539223 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.541223 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:34:06.542232 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:34:06.542232 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:34:06.542232 [info ] [Thread-1 (]: 8 of 47 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m06:34:06.543240 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:34:06.543744 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:34:06.543744 [info ] [Thread-1 (]: 9 of 47 START test not_null_dim_instituicao_id_localizacao ..................... [RUN]
[0m06:34:06.543744 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:34:06.544749 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:34:06.547741 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:34:06.548745 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:34:06.549870 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:34:06.550971 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:34:06.550971 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:34:06.550971 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.551789 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.551789 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:34:06.551789 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.552896 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.554078 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:34:06.554078 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:34:06.554078 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:34:06.554078 [info ] [Thread-1 (]: 9 of 47 PASS not_null_dim_instituicao_id_localizacao ........................... [[32mPASS[0m in 0.01s]
[0m06:34:06.555865 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:34:06.556167 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:34:06.556167 [info ] [Thread-1 (]: 10 of 47 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:34:06.556969 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:34:06.556969 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:34:06.563063 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:34:06.563063 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:34:06.564830 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:34:06.566112 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:34:06.566112 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:34:06.566112 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.567126 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.567126 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:34:06.567126 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.569334 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.571013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:34:06.572019 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:34:06.572524 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:34:06.573029 [info ] [Thread-1 (]: 10 of 47 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.573029 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:34:06.573029 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:34:06.573029 [info ] [Thread-1 (]: 11 of 47 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:06.573029 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:34:06.573029 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:34:06.577515 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:34:06.579021 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:34:06.580531 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:34:06.581536 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:34:06.581536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:34:06.581536 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.582292 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.582691 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:34:06.582691 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.588348 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:34:06.589354 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:34:06.589354 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:34:06.590859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:34:06.590859 [info ] [Thread-1 (]: 11 of 47 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.590859 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:34:06.590859 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:34:06.590859 [info ] [Thread-1 (]: 12 of 47 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:06.592553 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:34:06.593080 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:34:06.596156 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:34:06.596841 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:34:06.598633 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:34:06.599643 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:34:06.599643 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:34:06.599643 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.600760 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.600760 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:34:06.600760 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.605667 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:34:06.607783 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:34:06.607783 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:34:06.607783 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:34:06.607783 [info ] [Thread-1 (]: 12 of 47 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.609396 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:34:06.609911 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:34:06.609911 [info ] [Thread-1 (]: 13 of 47 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:06.610562 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:34:06.610562 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:34:06.615182 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:34:06.615860 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:34:06.617170 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:34:06.618176 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:34:06.618176 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:34:06.618176 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.619585 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.619585 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:34:06.619585 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.623400 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:06.624504 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:34:06.625673 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:34:06.625673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:34:06.625673 [info ] [Thread-1 (]: 13 of 47 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.626709 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:34:06.626709 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:34:06.626709 [info ] [Thread-1 (]: 14 of 47 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:06.627761 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:34:06.627761 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:34:06.632015 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:34:06.633954 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:34:06.635661 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:34:06.636695 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:34:06.636695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:34:06.636695 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.637693 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.637693 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:34:06.638387 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.643534 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:34:06.645042 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:34:06.646047 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:34:06.646047 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:34:06.647500 [info ] [Thread-1 (]: 14 of 47 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.647500 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:34:06.648505 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:34:06.649088 [info ] [Thread-1 (]: 15 of 47 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:06.649088 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:34:06.649624 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:34:06.652937 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:34:06.654467 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:34:06.655490 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:34:06.656519 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:34:06.656519 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:34:06.656519 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.658025 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.658025 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:34:06.658025 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.669425 [debug] [Thread-1 (]: SQL status: OK in 0.011 seconds
[0m06:34:06.670928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:34:06.670928 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:34:06.670928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:34:06.672729 [info ] [Thread-1 (]: 15 of 47 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.672729 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:34:06.673733 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:34:06.674235 [info ] [Thread-1 (]: 16 of 47 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:06.674235 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:34:06.674737 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:34:06.678451 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:34:06.678451 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:34:06.680958 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:34:06.681964 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:34:06.681964 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:34:06.681964 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.682968 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.683471 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:34:06.683471 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.685993 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.686996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:34:06.688499 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:34:06.688499 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:34:06.689503 [info ] [Thread-1 (]: 16 of 47 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.689503 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:34:06.689503 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:34:06.689503 [info ] [Thread-1 (]: 17 of 47 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:06.691006 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:34:06.691006 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:34:06.695021 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:34:06.696025 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:34:06.699008 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:34:06.699807 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:34:06.699807 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:34:06.700810 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.701312 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.701312 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:34:06.701987 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.705506 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:34:06.706510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:34:06.707513 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:34:06.708515 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:34:06.708515 [info ] [Thread-1 (]: 17 of 47 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.708515 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:34:06.708515 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:34:06.710021 [info ] [Thread-1 (]: 18 of 47 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:34:06.710021 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:34:06.710642 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:34:06.714351 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:34:06.715444 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:34:06.717134 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:34:06.717134 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:34:06.718721 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:34:06.718721 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.719315 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.719315 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:34:06.719315 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:06.722869 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:06.723382 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:34:06.724947 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:34:06.725346 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:34:06.725849 [info ] [Thread-1 (]: 18 of 47 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:34:06.725849 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:34:06.725849 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:34:06.726877 [info ] [Thread-1 (]: 19 of 47 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:34:06.726877 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:34:06.726877 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:34:06.729964 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:34:06.730971 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:34:06.731981 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:34:06.733491 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:34:06.733491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:34:06.734178 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.734178 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.734828 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:34:06.734828 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.735834 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.736340 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:34:06.737345 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:34:06.737869 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:34:06.738211 [info ] [Thread-1 (]: 19 of 47 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:34:06.738715 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:34:06.738715 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:34:06.738715 [info ] [Thread-1 (]: 20 of 47 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:34:06.739720 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:34:06.739720 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:34:06.743241 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:34:06.744774 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:34:06.746869 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:34:06.746869 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:34:06.746869 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:34:06.746869 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.748489 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.748489 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:34:06.749180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.750060 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.751570 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:34:06.752576 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:34:06.752576 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:34:06.752576 [info ] [Thread-1 (]: 20 of 47 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.01s]
[0m06:34:06.752576 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:34:06.752576 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:34:06.754081 [info ] [Thread-1 (]: 21 of 47 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:34:06.754081 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:34:06.754081 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:34:06.757177 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:34:06.758185 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:34:06.759709 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:34:06.760993 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:34:06.760993 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:34:06.760993 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.762021 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.762021 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:34:06.762021 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:06.763023 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.764664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:34:06.765671 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:34:06.766175 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:34:06.766789 [info ] [Thread-1 (]: 21 of 47 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.01s]
[0m06:34:06.766789 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:34:06.766789 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:34:06.767794 [info ] [Thread-1 (]: 22 of 47 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:34:06.767794 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:34:06.767794 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:34:06.771916 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:34:06.772467 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:34:06.774501 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:34:06.775025 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:34:06.775025 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:34:06.775025 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.776053 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.776053 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:34:06.776053 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.777052 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.778038 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:34:06.779038 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:34:06.779543 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:34:06.780047 [info ] [Thread-1 (]: 22 of 47 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m06:34:06.780047 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:34:06.780047 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:34:06.781052 [info ] [Thread-1 (]: 23 of 47 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:06.781052 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:34:06.781556 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:34:06.785736 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:34:06.786241 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:34:06.788482 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:34:06.788482 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:34:06.789496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:34:06.789496 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.789496 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.789496 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:34:06.789496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.793583 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:06.794627 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:34:06.794627 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:34:06.795984 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:34:06.795984 [info ] [Thread-1 (]: 23 of 47 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:06.796667 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:34:06.796667 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:34:06.796667 [info ] [Thread-1 (]: 24 of 47 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:06.797452 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:34:06.797452 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:34:06.801220 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:34:06.801862 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:34:06.803878 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:34:06.803878 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:34:06.804885 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:34:06.804885 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.804885 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.805889 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:34:06.805889 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.807930 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.808900 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:34:06.810537 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:34:06.810537 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:34:06.810537 [info ] [Thread-1 (]: 24 of 47 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:06.811549 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:34:06.811549 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:34:06.811549 [info ] [Thread-1 (]: 25 of 47 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:06.811549 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:34:06.811549 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:34:06.815516 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:34:06.817028 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:34:06.818035 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:34:06.819539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:34:06.819539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:34:06.819539 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.819539 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.819539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:34:06.821045 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.822554 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.823058 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:34:06.824648 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:34:06.824648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:34:06.825013 [info ] [Thread-1 (]: 25 of 47 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:06.825518 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:34:06.825518 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:34:06.825518 [info ] [Thread-1 (]: 26 of 47 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:06.826524 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:34:06.826524 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:34:06.830061 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:34:06.831068 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:34:06.833588 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:34:06.834258 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:34:06.834957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:34:06.834957 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.835685 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.835685 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:34:06.835685 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.838211 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.838211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:34:06.839734 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:34:06.839734 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:34:06.839734 [info ] [Thread-1 (]: 26 of 47 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:06.840763 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:34:06.840763 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:34:06.840763 [info ] [Thread-1 (]: 27 of 47 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:06.840763 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:34:06.842356 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:34:06.844873 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:34:06.846580 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:34:06.848260 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:34:06.848764 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:34:06.849324 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:34:06.849324 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.850076 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.850076 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:34:06.850771 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.853002 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.854022 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:34:06.854022 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:34:06.854022 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:34:06.855693 [info ] [Thread-1 (]: 27 of 47 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:06.855693 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:34:06.855693 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:34:06.856725 [info ] [Thread-1 (]: 28 of 47 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:06.857013 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:34:06.857013 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:34:06.860571 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:34:06.861686 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:34:06.863632 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:34:06.863632 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:34:06.863632 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:34:06.865064 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.865579 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.865579 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:34:06.865579 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.866868 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.867981 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:34:06.868976 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:34:06.868976 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:34:06.869589 [info ] [Thread-1 (]: 28 of 47 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:06.870213 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:34:06.870213 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:34:06.870838 [info ] [Thread-1 (]: 29 of 47 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:06.870838 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:34:06.870838 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:34:06.874459 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:34:06.875173 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:34:06.877284 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:34:06.877284 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:34:06.878296 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:34:06.878296 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.878296 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.879282 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:34:06.879282 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.881668 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.881668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:34:06.883414 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:34:06.883731 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:34:06.884340 [info ] [Thread-1 (]: 29 of 47 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:06.884340 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:34:06.884340 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:34:06.885148 [info ] [Thread-1 (]: 30 of 47 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:34:06.885148 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:34:06.885148 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:34:06.888696 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:34:06.888696 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:34:06.890317 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:34:06.891443 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:34:06.892061 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:34:06.892061 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.892061 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.892061 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:34:06.892061 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:06.893839 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.895455 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:34:06.896461 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:34:06.896461 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:34:06.897102 [info ] [Thread-1 (]: 30 of 47 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m06:34:06.897102 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:34:06.897102 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:34:06.897102 [info ] [Thread-1 (]: 31 of 47 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:34:06.897102 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:34:06.898670 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:34:06.901458 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:34:06.901458 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:34:06.903970 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:34:06.905486 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:34:06.905486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:34:06.905486 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.906493 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.906493 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:34:06.906493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.907493 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.908493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:34:06.908493 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:34:06.908493 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:34:06.909998 [info ] [Thread-1 (]: 31 of 47 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:34:06.910568 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:34:06.910568 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:34:06.910568 [info ] [Thread-1 (]: 32 of 47 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:34:06.911689 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:34:06.911689 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:34:06.913738 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:34:06.914848 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:34:06.917026 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:34:06.917799 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:34:06.917799 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:34:06.917799 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.917799 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.917799 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:34:06.917799 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.919923 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.921026 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:34:06.921026 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:34:06.921026 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:34:06.922132 [info ] [Thread-1 (]: 32 of 47 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:34:06.922763 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:34:06.922763 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:34:06.923367 [info ] [Thread-1 (]: 33 of 47 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:06.923367 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:34:06.923367 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:34:06.926782 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:34:06.927788 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:34:06.930102 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:34:06.930102 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:34:06.931108 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:34:06.931108 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.931613 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.932117 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:34:06.932117 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.934478 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:06.935585 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:34:06.936202 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:34:06.936202 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:34:06.936202 [info ] [Thread-1 (]: 33 of 47 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:06.936202 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:34:06.937814 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:34:06.937814 [info ] [Thread-1 (]: 34 of 47 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:06.938507 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:34:06.938507 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:34:06.942337 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:34:06.942954 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:34:06.944679 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:34:06.945288 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:34:06.945288 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:34:06.945288 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.946398 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.946398 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:34:06.947065 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:06.951950 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:34:06.952957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:34:06.953957 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:34:06.953957 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:34:06.954463 [info ] [Thread-1 (]: 34 of 47 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:06.954463 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:34:06.954463 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:34:06.954463 [info ] [Thread-1 (]: 35 of 47 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:34:06.955970 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:34:06.955970 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:34:06.957977 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.958977 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:34:06.960986 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.962499 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.962499 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:34:06.962499 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.963012 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.963012 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.963012 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:34:06.964642 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.964642 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.964642 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m06:34:06.965830 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.966587 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.966587 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m06:34:06.967594 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.970108 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.971107 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m06:34:06.971611 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.973470 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.973470 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:34:06.974475 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.975322 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:34:06.975322 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.975826 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:34:06.978002 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:06.980174 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:06.981286 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:34:06.982105 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:06.983130 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:34:06.983130 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000223277C8500>]}
[0m06:34:06.984129 [info ] [Thread-1 (]: 35 of 47 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:34:06.984129 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:34:06.984845 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:34:06.984845 [info ] [Thread-1 (]: 36 of 47 START sql table model main.dim_controle ............................... [RUN]
[0m06:34:06.985435 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:34:06.985972 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:34:06.987589 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:06.988659 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:34:06.991080 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:06.992086 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:06.992086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:34:06.992645 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:06.993149 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.993149 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:06.993149 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:34:06.993775 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.994830 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:06.994830 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m06:34:06.995453 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.996700 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:06.997002 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m06:34:06.997527 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:06.999185 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:06.999965 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m06:34:06.999965 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.001588 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:07.002614 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:34:07.002614 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.003614 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:34:07.003614 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:07.003614 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:34:07.005614 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.006623 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:07.007629 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:34:07.008404 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.009574 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:34:07.010145 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022327772C90>]}
[0m06:34:07.010145 [info ] [Thread-1 (]: 36 of 47 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.02s]
[0m06:34:07.010732 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:34:07.010732 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:34:07.011569 [info ] [Thread-1 (]: 37 of 47 START sql table model main.dim_segmento ............................... [RUN]
[0m06:34:07.011569 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:34:07.011569 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:34:07.014087 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.014593 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:34:07.018618 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.019148 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.019148 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:34:07.019148 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.019148 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.019148 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.020851 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:34:07.020851 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.022363 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.022363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m06:34:07.022363 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.023368 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.024375 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m06:34:07.024881 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.026424 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.027423 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m06:34:07.027423 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.029424 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.029928 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:34:07.029928 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.030937 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:34:07.031442 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.031442 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:34:07.032951 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.034533 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:07.035071 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:34:07.036081 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.036081 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:34:07.036081 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000223277CD790>]}
[0m06:34:07.037708 [info ] [Thread-1 (]: 37 of 47 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m06:34:07.038290 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:34:07.038290 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:34:07.039296 [info ] [Thread-1 (]: 38 of 47 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:34:07.039296 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:34:07.039296 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:34:07.043544 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:34:07.043544 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:34:07.045132 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:34:07.046164 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:34:07.046750 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:34:07.046750 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.047382 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.047382 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:34:07.047382 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:34:07.048394 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.049525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:34:07.049525 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:34:07.049525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:34:07.051182 [info ] [Thread-1 (]: 38 of 47 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:34:07.051857 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:34:07.051857 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:34:07.052486 [info ] [Thread-1 (]: 39 of 47 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:34:07.052486 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:34:07.052486 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:34:07.056521 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:34:07.057520 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:34:07.058522 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:34:07.060028 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:34:07.060607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:34:07.060607 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.060607 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.061613 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:34:07.061613 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:07.063119 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.064630 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:34:07.065135 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:34:07.065650 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:34:07.065650 [info ] [Thread-1 (]: 39 of 47 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m06:34:07.066231 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:34:07.066764 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:34:07.066764 [info ] [Thread-1 (]: 40 of 47 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:34:07.067769 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:34:07.067769 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:34:07.069274 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:34:07.070884 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:34:07.073189 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:34:07.074352 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:34:07.075012 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:34:07.075012 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.075810 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.075810 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:34:07.075810 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:07.077816 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.077816 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:34:07.079439 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:34:07.079439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:34:07.080104 [info ] [Thread-1 (]: 40 of 47 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:34:07.080104 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:34:07.080104 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:34:07.081204 [info ] [Thread-1 (]: 41 of 47 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:34:07.081204 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:34:07.081708 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:34:07.084541 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:34:07.085159 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:34:07.086770 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:34:07.087877 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:34:07.087877 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:34:07.087877 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.088668 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.088668 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:34:07.088668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:34:07.089797 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.090795 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:34:07.090795 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:34:07.090795 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:34:07.092590 [info ] [Thread-1 (]: 41 of 47 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:34:07.092590 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:34:07.093120 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:34:07.093120 [info ] [Thread-1 (]: 42 of 47 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:34:07.093120 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:34:07.093120 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:34:07.097613 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:34:07.097613 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:34:07.099688 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:34:07.100694 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:34:07.101198 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:34:07.101198 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.102025 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.102025 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:34:07.102025 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:07.103644 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.105370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:34:07.105370 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:34:07.105370 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:34:07.106479 [info ] [Thread-1 (]: 42 of 47 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m06:34:07.106479 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:34:07.107428 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:34:07.107428 [info ] [Thread-1 (]: 43 of 47 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:34:07.107428 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:34:07.107428 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:34:07.110746 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:34:07.111752 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:34:07.111752 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:34:07.113361 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:34:07.113361 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:34:07.113361 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.114936 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.114936 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:34:07.114936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:07.116705 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.116705 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:34:07.117815 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:34:07.117815 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:34:07.118825 [info ] [Thread-1 (]: 43 of 47 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:34:07.118825 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:34:07.118825 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:34:07.118825 [info ] [Thread-1 (]: 44 of 47 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:34:07.120116 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:34:07.120116 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:34:07.122011 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:34:07.123525 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:34:07.125045 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:34:07.126052 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:34:07.126052 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:34:07.127052 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.127052 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.127052 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:34:07.128051 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:34:07.128051 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.129557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:34:07.129557 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:34:07.129557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:34:07.129557 [info ] [Thread-1 (]: 44 of 47 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:34:07.131344 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:34:07.131344 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:34:07.132101 [info ] [Thread-1 (]: 45 of 47 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:34:07.132101 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:34:07.132101 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:34:07.137490 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:34:07.138628 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:34:07.139635 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:34:07.139635 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:34:07.141141 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:34:07.141141 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.141141 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.142147 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:34:07.142147 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:07.143157 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.144679 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:34:07.145685 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:34:07.146189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:34:07.146189 [info ] [Thread-1 (]: 45 of 47 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.01s]
[0m06:34:07.146814 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:34:07.147516 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:34:07.147516 [info ] [Thread-1 (]: 46 of 47 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:34:07.147516 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:34:07.148523 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:34:07.151386 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:34:07.151386 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:34:07.153896 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:34:07.153896 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:34:07.155413 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:34:07.155413 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.156044 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.156044 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:34:07.156044 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:07.158049 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.159048 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:34:07.160079 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:34:07.160834 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:34:07.160834 [info ] [Thread-1 (]: 46 of 47 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m06:34:07.160834 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:34:07.161847 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:34:07.161847 [info ] [Thread-1 (]: 47 of 47 START sql view model main.view_resumo_financeiro_relatorios ........... [RUN]
[0m06:34:07.161847 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios)
[0m06:34:07.163350 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:34:07.166119 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:34:07.166639 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:34:07.178597 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:34:07.179656 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:34:07.180158 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: BEGIN
[0m06:34:07.180158 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:07.180158 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.180158 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:34:07.181203 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    
    -- Data
    t.data as data_base,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
  );

[0m06:34:07.182452 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.184155 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:34:07.184943 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */
alter view "gold_warehouse"."main"."view_resumo_financeiro_relatorios" rename to "view_resumo_financeiro_relatorios__dbt_backup"
[0m06:34:07.184943 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.186953 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:34:07.187557 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */
alter view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" rename to "view_resumo_financeiro_relatorios"
[0m06:34:07.187557 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:07.188290 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m06:34:07.188290 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:34:07.189295 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m06:34:07.190798 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.192406 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:34:07.192406 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_backup" cascade
    
[0m06:34:07.193422 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:07.193422 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: Close
[0m06:34:07.195054 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '6c9a5356-0cd4-4fb2-b534-a18123078e82', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022306C32510>]}
[0m06:34:07.195054 [info ] [Thread-1 (]: 47 of 47 OK created sql view model main.view_resumo_financeiro_relatorios ...... [[32mOK[0m in 0.03s]
[0m06:34:07.196088 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:34:07.197185 [debug] [MainThread]: Using duckdb connection "master"
[0m06:34:07.197185 [debug] [MainThread]: On master: BEGIN
[0m06:34:07.197185 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:34:07.197185 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:34:07.197185 [debug] [MainThread]: On master: COMMIT
[0m06:34:07.197185 [debug] [MainThread]: Using duckdb connection "master"
[0m06:34:07.197185 [debug] [MainThread]: On master: COMMIT
[0m06:34:07.198811 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:34:07.198811 [debug] [MainThread]: On master: Close
[0m06:34:07.198811 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:34:07.199597 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:34:07.199597 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:34:07.199597 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' was properly closed.
[0m06:34:07.199597 [info ] [MainThread]: 
[0m06:34:07.199597 [info ] [MainThread]: Finished running 3 seeds, 7 table models, 36 data tests, 1 view model in 0 hours 0 minutes and 2.17 seconds (2.17s).
[0m06:34:07.202929 [debug] [MainThread]: Command end result
[0m06:34:07.232071 [debug] [MainThread]: Wrote artifact WritableManifest to src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:34:07.233826 [debug] [MainThread]: Wrote artifact SemanticManifest to src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:34:07.238439 [debug] [MainThread]: Wrote artifact RunExecutionResult to src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:34:07.239442 [info ] [MainThread]: 
[0m06:34:07.240083 [info ] [MainThread]: [32mCompleted successfully[0m
[0m06:34:07.240083 [info ] [MainThread]: 
[0m06:34:07.240083 [info ] [MainThread]: Done. PASS=47 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=47
[0m06:34:07.241117 [debug] [MainThread]: Command `dbt build` succeeded at 06:34:07.241117 after 3.21 seconds
[0m06:34:07.241117 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000223045A27E0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022304756300>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000022304A11AC0>]}
[0m06:34:07.241117 [debug] [MainThread]: Flushing usage events
[0m06:34:07.985429 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:34:45.179556 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E94BE0F0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E94BE180>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E94BD430>]}


============================== 06:34:45.185211 | ae400d57-3066-4e18-b291-6baca28fbd67 ==============================
[0m06:34:45.185211 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:34:45.185211 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'use_colors': 'True', 'indirect_selection': 'eager', 'invocation_command': 'dbt build', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:34:45.359709 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EAD4D6D0>]}
[0m06:34:45.409002 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EAD63440>]}
[0m06:34:45.411521 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:34:45.648656 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:34:45.740935 [info ] [MainThread]: Unable to do partial parsing because profile has changed
[0m06:34:45.740935 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E94767B0>]}
[0m06:34:46.971390 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on 'dim_instituicao'
in package 'bacen_ifdata_analytics' (models\gold\schema.yml). Arguments to
generic tests should be nested under the `arguments` property.
[0m06:34:46.972027 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EB79A990>]}
[0m06:34:47.314374 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:34:47.323483 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EB74A6C0>]}
[0m06:34:47.401866 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:34:47.403905 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:34:47.454069 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EB67D250>]}
[0m06:34:47.454069 [info ] [MainThread]: Found 27 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:34:47.461210 [info ] [MainThread]: 
[0m06:34:47.461210 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:34:47.461210 [info ] [MainThread]: 
[0m06:34:47.462223 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:34:47.468302 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:34:47.541113 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:34:47.542120 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:34:47.542120 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:34:47.641997 [debug] [ThreadPool]: SQL status: OK in 0.100 seconds
[0m06:34:47.644086 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:34:47.644610 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:34:47.644610 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:34:47.649627 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:34:47.649627 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:34:47.649627 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:34:47.651168 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:34:47.651907 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:34:47.652914 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:34:47.652914 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:34:47.652914 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:34:47.652914 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:34:47.653913 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:34:47.654458 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:34:47.654458 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:34:47.655482 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:34:47.655482 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:34:47.655482 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:34:47.658023 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:34:47.662068 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:34:47.663067 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:34:47.663067 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:34:47.663576 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:34:47.663576 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:34:47.663576 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:34:47.674375 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m06:34:47.674935 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:34:47.675483 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:34:47.676510 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:34:47.676510 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EB6A7C80>]}
[0m06:34:47.677495 [debug] [MainThread]: Using duckdb connection "master"
[0m06:34:47.677495 [debug] [MainThread]: On master: BEGIN
[0m06:34:47.677495 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:34:47.677495 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:34:47.678495 [debug] [MainThread]: On master: COMMIT
[0m06:34:47.678495 [debug] [MainThread]: Using duckdb connection "master"
[0m06:34:47.679001 [debug] [MainThread]: On master: COMMIT
[0m06:34:47.679001 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:34:47.679505 [debug] [MainThread]: On master: Close
[0m06:34:47.682997 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:34:47.683581 [info ] [Thread-1 (]: 1 of 98 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:34:47.684105 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:34:47.684105 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:34:47.697039 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:47.697039 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:34:47.719371 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:47.719915 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:47.720928 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:34:47.720928 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:34:47.721464 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:47.721969 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:47.721969 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:34:48.182061 [debug] [Thread-1 (]: SQL status: OK in 0.459 seconds
[0m06:34:48.186378 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:48.186378 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:34:48.187890 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:48.196885 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:34:48.196885 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:48.198515 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:34:48.212292 [debug] [Thread-1 (]: SQL status: OK in 0.014 seconds
[0m06:34:48.216903 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:34:48.217909 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:34:48.217909 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:48.219414 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:34:48.222144 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E67CDCD0>]}
[0m06:34:48.222735 [info ] [Thread-1 (]: 1 of 98 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.54s]
[0m06:34:48.223259 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:34:48.223259 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:34:48.224264 [info ] [Thread-1 (]: 2 of 98 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:34:48.224767 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:34:48.224767 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:34:48.228417 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:48.229410 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:34:48.232124 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:48.233200 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:48.233200 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:34:48.233200 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:48.234720 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:48.234720 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:48.235290 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:34:48.320627 [debug] [Thread-1 (]: SQL status: OK in 0.085 seconds
[0m06:34:48.323232 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:48.323232 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:34:48.323232 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:48.325116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:34:48.325116 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:48.325648 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:34:48.327227 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:48.329226 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:34:48.329748 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:34:48.329748 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:48.329748 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:34:48.331431 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBB9CE60>]}
[0m06:34:48.332117 [info ] [Thread-1 (]: 2 of 98 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.11s]
[0m06:34:48.333122 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:34:48.333122 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:34:48.333726 [info ] [Thread-1 (]: 3 of 98 START sql table model main.dim_tempo ................................... [RUN]
[0m06:34:48.334323 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:34:48.334323 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:34:48.341879 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:48.341879 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:34:48.345089 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:48.346629 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:48.346629 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:34:48.347197 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:48.347197 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:48.347197 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:48.347197 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:34:48.410448 [debug] [Thread-1 (]: SQL status: OK in 0.061 seconds
[0m06:34:48.411482 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:48.413014 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:34:48.413014 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:48.414575 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:34:48.414575 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:48.414575 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:34:48.417249 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:48.419950 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:34:48.419950 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:34:48.419950 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:48.421495 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:34:48.422017 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF927C80>]}
[0m06:34:48.422017 [info ] [Thread-1 (]: 3 of 98 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.09s]
[0m06:34:48.423029 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:34:48.423029 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:34:48.423533 [info ] [Thread-1 (]: 4 of 98 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:34:48.423533 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:34:48.424560 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:34:48.428330 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:34:48.429860 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:34:48.432432 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:34:48.434159 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:34:48.434681 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:34:48.435297 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:48.436305 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:48.436305 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:34:48.437837 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:34:49.099209 [debug] [Thread-1 (]: SQL status: OK in 0.660 seconds
[0m06:34:49.101694 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:34:49.101694 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:34:49.102709 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.103726 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:34:49.103726 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:34:49.103726 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:34:49.229257 [debug] [Thread-1 (]: SQL status: OK in 0.125 seconds
[0m06:34:49.232521 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:34:49.232521 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:34:49.233042 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.233884 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:34:49.233884 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBB85070>]}
[0m06:34:49.234911 [info ] [Thread-1 (]: 4 of 98 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.81s]
[0m06:34:49.236108 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:34:49.236108 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:34:49.236108 [info ] [Thread-1 (]: 5 of 98 START sql table model main.fato_capital_prudencial ..................... [RUN]
[0m06:34:49.237618 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m06:34:49.237618 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:34:49.242060 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:34:49.242060 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:34:49.248526 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:34:49.249675 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:34:49.251177 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m06:34:49.251780 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:49.252786 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:49.252786 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:34:49.254316 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Prudencial')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m06:34:49.483765 [debug] [Thread-1 (]: SQL status: OK in 0.229 seconds
[0m06:34:49.486386 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:34:49.486386 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m06:34:49.486386 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.488295 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:34:49.488910 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:34:49.488910 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m06:34:49.503934 [debug] [Thread-1 (]: SQL status: OK in 0.015 seconds
[0m06:34:49.506793 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m06:34:49.506793 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m06:34:49.507688 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.508811 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m06:34:49.508811 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF90D520>]}
[0m06:34:49.508811 [info ] [Thread-1 (]: 5 of 98 OK created sql table model main.fato_capital_prudencial ................ [[32mOK[0m in 0.27s]
[0m06:34:49.511066 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m06:34:49.511066 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:34:49.512076 [info ] [Thread-1 (]: 6 of 98 START sql table model main.fato_carteira_credito_indexador ............. [RUN]
[0m06:34:49.512076 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m06:34:49.514122 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:34:49.520110 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:34:49.521055 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:34:49.525542 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:34:49.527058 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:34:49.528170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m06:34:49.529134 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:49.530273 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:49.531393 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:34:49.532014 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro (SCR)')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m06:34:49.577894 [debug] [Thread-1 (]: SQL status: OK in 0.046 seconds
[0m06:34:49.580971 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:34:49.580971 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m06:34:49.582524 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.583649 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:34:49.583649 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:34:49.584262 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m06:34:49.609284 [debug] [Thread-1 (]: SQL status: OK in 0.025 seconds
[0m06:34:49.611511 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m06:34:49.611511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m06:34:49.613019 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.613019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m06:34:49.614629 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBBCA600>]}
[0m06:34:49.614629 [info ] [Thread-1 (]: 6 of 98 OK created sql table model main.fato_carteira_credito_indexador ........ [[32mOK[0m in 0.10s]
[0m06:34:49.615635 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m06:34:49.616139 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:34:49.616680 [info ] [Thread-1 (]: 7 of 98 START sql table model main.fato_carteira_credito_totais ................ [RUN]
[0m06:34:49.616680 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m06:34:49.616680 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:34:49.621213 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:34:49.622221 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:34:49.625466 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:34:49.626478 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:34:49.626478 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m06:34:49.626478 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:49.627476 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.627476 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:34:49.627476 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m06:34:49.674411 [debug] [Thread-1 (]: SQL status: OK in 0.046 seconds
[0m06:34:49.676549 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:34:49.676549 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m06:34:49.677550 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.678549 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:34:49.678549 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:34:49.678549 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m06:34:49.743897 [debug] [Thread-1 (]: SQL status: OK in 0.065 seconds
[0m06:34:49.744902 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m06:34:49.744902 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m06:34:49.746565 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.747776 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m06:34:49.747776 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBB148F0>]}
[0m06:34:49.748781 [info ] [Thread-1 (]: 7 of 98 OK created sql table model main.fato_carteira_credito_totais ........... [[32mOK[0m in 0.13s]
[0m06:34:49.749346 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m06:34:49.749346 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:34:49.750088 [info ] [Thread-1 (]: 8 of 98 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m06:34:49.750904 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m06:34:49.750904 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:34:49.756707 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:34:49.757713 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:34:49.760214 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:34:49.760908 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:34:49.761916 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m06:34:49.761916 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:49.761916 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:49.762916 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:34:49.762916 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        NULL as juros_sobre_capital_social_cooperativas,
        dre.juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio as rendas_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas,
        NULL as juros_sobre_capital_proprio,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    rendas_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital_social_cooperativas,
    juros_sobre_capital_proprio
FROM dre
    );
  
  
[0m06:34:50.291859 [debug] [Thread-1 (]: SQL status: OK in 0.528 seconds
[0m06:34:50.293300 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:34:50.293300 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m06:34:50.294918 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.295952 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:34:50.296567 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:34:50.296567 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m06:34:50.394915 [debug] [Thread-1 (]: SQL status: OK in 0.098 seconds
[0m06:34:50.397143 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m06:34:50.397143 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m06:34:50.397143 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.398877 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m06:34:50.398877 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBB17560>]}
[0m06:34:50.399642 [info ] [Thread-1 (]: 8 of 98 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.65s]
[0m06:34:50.399642 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m06:34:50.400654 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:34:50.401184 [info ] [Thread-1 (]: 9 of 98 START sql table model main.fato_movimentacao_cambio .................... [RUN]
[0m06:34:50.401692 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m06:34:50.401692 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:34:50.404824 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:34:50.405332 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:34:50.408351 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:34:50.408351 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:34:50.409869 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m06:34:50.409869 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:50.409869 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.409869 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:34:50.411105 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m06:34:50.415757 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:34:50.417862 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:34:50.418896 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m06:34:50.418896 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.419910 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:34:50.420744 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:34:50.421310 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m06:34:50.424405 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:50.426089 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m06:34:50.427086 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m06:34:50.427086 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.428074 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m06:34:50.428074 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBB7C230>]}
[0m06:34:50.428074 [info ] [Thread-1 (]: 9 of 98 OK created sql table model main.fato_movimentacao_cambio ............... [[32mOK[0m in 0.03s]
[0m06:34:50.429582 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m06:34:50.429582 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:34:50.431193 [info ] [Thread-1 (]: 10 of 98 START sql table model main.fato_operacoes_clientes .................... [RUN]
[0m06:34:50.431789 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m06:34:50.431789 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:34:50.434350 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:34:50.435587 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:34:50.439425 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:34:50.440931 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:34:50.441973 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m06:34:50.441973 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:50.442513 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.443020 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:34:50.443020 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m06:34:50.468855 [debug] [Thread-1 (]: SQL status: OK in 0.025 seconds
[0m06:34:50.470860 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:34:50.471364 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m06:34:50.471869 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.471869 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:34:50.471869 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:34:50.471869 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m06:34:50.479522 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:34:50.481371 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m06:34:50.481371 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m06:34:50.482169 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.483306 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m06:34:50.483306 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF97DAC0>]}
[0m06:34:50.483916 [info ] [Thread-1 (]: 10 of 98 OK created sql table model main.fato_operacoes_clientes ............... [[32mOK[0m in 0.05s]
[0m06:34:50.484453 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m06:34:50.484961 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:34:50.485488 [info ] [Thread-1 (]: 11 of 98 START sql table model main.fato_resumo_financeiro ..................... [RUN]
[0m06:34:50.486034 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m06:34:50.486034 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:34:50.488721 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:50.489727 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:34:50.492240 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:50.492240 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:50.493708 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m06:34:50.493708 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:50.493708 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.494715 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:50.495222 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m06:34:50.747067 [debug] [Thread-1 (]: SQL status: OK in 0.252 seconds
[0m06:34:50.750552 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:50.750552 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m06:34:50.751166 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.751815 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:34:50.752417 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:50.752417 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m06:34:50.893809 [debug] [Thread-1 (]: SQL status: OK in 0.141 seconds
[0m06:34:50.895322 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m06:34:50.896326 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m06:34:50.897030 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.897030 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m06:34:50.898037 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF927C50>]}
[0m06:34:50.898542 [info ] [Thread-1 (]: 11 of 98 OK created sql table model main.fato_resumo_financeiro ................ [[32mOK[0m in 0.41s]
[0m06:34:50.899057 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m06:34:50.899586 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:34:50.899586 [info ] [Thread-1 (]: 12 of 98 START seed file main.seed_dim_atividade ............................... [RUN]
[0m06:34:50.900591 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m06:34:50.900591 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:34:50.901156 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:34:50.921546 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:34:50.922052 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m06:34:50.922052 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:50.923060 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.923060 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:34:50.923563 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m06:34:50.924574 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.931902 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:34:50.932266 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:50.936452 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:34:50.941365 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:34:50.942387 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:34:50.943420 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m06:34:50.943420 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m06:34:50.944956 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.945961 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m06:34:50.946465 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF927C50>]}
[0m06:34:50.946970 [info ] [Thread-1 (]: 12 of 98 OK loaded seed file main.seed_dim_atividade ........................... [[32mINSERT 10[0m in 0.05s]
[0m06:34:50.946970 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m06:34:50.946970 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:34:50.946970 [info ] [Thread-1 (]: 13 of 98 START seed file main.seed_dim_classe_instituicao ...................... [RUN]
[0m06:34:50.948690 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:34:50.949228 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:34:50.949228 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:34:50.953865 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:34:50.954222 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:34:50.954222 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:50.954871 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.954871 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:34:50.955872 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m06:34:50.955872 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.957345 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:34:50.957345 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:50.958332 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.958332 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:34:50.960933 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:34:50.960933 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:34:50.960933 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:34:50.961956 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.963477 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:34:50.963815 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBB15D60>]}
[0m06:34:50.963815 [info ] [Thread-1 (]: 13 of 98 OK loaded seed file main.seed_dim_classe_instituicao .................. [[32mINSERT 32[0m in 0.01s]
[0m06:34:50.964489 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:34:50.964489 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:34:50.964489 [info ] [Thread-1 (]: 14 of 98 START seed file main.seed_dim_consolidado ............................. [RUN]
[0m06:34:50.965893 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:34:50.966570 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:34:50.966570 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:34:50.969117 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:50.969117 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:34:50.969117 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:50.969117 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.970639 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:50.970639 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m06:34:50.971168 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.972179 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:50.972179 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:50.973711 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.973711 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:50.975793 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:34:50.975793 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:34:50.975793 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:34:50.976813 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.977797 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:34:50.977797 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBC501A0>]}
[0m06:34:50.977797 [info ] [Thread-1 (]: 14 of 98 OK loaded seed file main.seed_dim_consolidado ......................... [[32mINSERT 8[0m in 0.01s]
[0m06:34:50.979300 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:34:50.979911 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:34:50.979911 [info ] [Thread-1 (]: 15 of 98 START seed file main.seed_dim_controle ................................ [RUN]
[0m06:34:50.980917 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:34:50.980917 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:34:50.981437 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:34:50.984323 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:50.984847 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:34:50.984847 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:50.985505 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.985505 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:50.985505 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m06:34:50.986508 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:50.986508 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:50.987528 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:50.988333 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.989344 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:50.990361 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:34:50.991345 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:34:50.991345 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:34:50.991872 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:50.993513 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:34:50.993513 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF9618B0>]}
[0m06:34:50.993513 [info ] [Thread-1 (]: 15 of 98 OK loaded seed file main.seed_dim_controle ............................ [[32mINSERT 3[0m in 0.01s]
[0m06:34:50.993513 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:34:50.995178 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:34:50.995178 [info ] [Thread-1 (]: 16 of 98 START seed file main.seed_dim_faixa_vencimento ........................ [RUN]
[0m06:34:50.995178 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m06:34:50.996348 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:34:50.996657 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:34:50.999764 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:34:50.999764 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m06:34:51.000204 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.000204 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.000204 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:34:51.000204 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m06:34:51.001225 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.002017 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:34:51.002017 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:51.004532 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.004532 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:34:51.007088 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:34:51.007088 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m06:34:51.007088 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m06:34:51.008102 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.009106 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m06:34:51.009106 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBCA6750>]}
[0m06:34:51.009106 [info ] [Thread-1 (]: 16 of 98 OK loaded seed file main.seed_dim_faixa_vencimento .................... [[32mINSERT 7[0m in 0.01s]
[0m06:34:51.011008 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m06:34:51.011008 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:34:51.011008 [info ] [Thread-1 (]: 17 of 98 START seed file main.seed_dim_porte ................................... [RUN]
[0m06:34:51.011008 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m06:34:51.012542 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:34:51.012542 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:34:51.016264 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:34:51.016264 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m06:34:51.016264 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.017304 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.017304 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:34:51.017304 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m06:34:51.017304 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.019334 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:34:51.019334 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:51.021046 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.021553 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:34:51.023068 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:34:51.023068 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m06:34:51.023068 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m06:34:51.025407 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.026432 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m06:34:51.026432 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF951A60>]}
[0m06:34:51.027410 [info ] [Thread-1 (]: 17 of 98 OK loaded seed file main.seed_dim_porte ............................... [[32mINSERT 6[0m in 0.02s]
[0m06:34:51.027410 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m06:34:51.028413 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:34:51.029413 [info ] [Thread-1 (]: 18 of 98 START seed file main.seed_dim_produto_credito ......................... [RUN]
[0m06:34:51.029413 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m06:34:51.030084 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:34:51.030084 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:34:51.032143 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:34:51.033952 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m06:34:51.033952 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.033952 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.034959 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:34:51.034959 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m06:34:51.035480 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.036510 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:34:51.036510 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:51.038650 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.039657 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:34:51.041169 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:34:51.041169 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m06:34:51.041169 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m06:34:51.042206 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.042206 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m06:34:51.043281 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF91A810>]}
[0m06:34:51.044291 [info ] [Thread-1 (]: 18 of 98 OK loaded seed file main.seed_dim_produto_credito ..................... [[32mINSERT 14[0m in 0.01s]
[0m06:34:51.044804 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m06:34:51.044804 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:34:51.044804 [info ] [Thread-1 (]: 19 of 98 START seed file main.seed_dim_regiao .................................. [RUN]
[0m06:34:51.044804 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m06:34:51.046351 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:34:51.046351 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:34:51.049778 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:34:51.049778 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m06:34:51.049778 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.049778 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.051360 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:34:51.051360 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m06:34:51.052365 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.052365 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:34:51.052365 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:51.055423 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.055423 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:34:51.058449 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:34:51.058449 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m06:34:51.058449 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m06:34:51.060991 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.061525 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m06:34:51.061525 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF97F470>]}
[0m06:34:51.061525 [info ] [Thread-1 (]: 19 of 98 OK loaded seed file main.seed_dim_regiao .............................. [[32mINSERT 7[0m in 0.02s]
[0m06:34:51.063030 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m06:34:51.063030 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:34:51.063030 [info ] [Thread-1 (]: 20 of 98 START seed file main.seed_dim_risco ................................... [RUN]
[0m06:34:51.064578 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m06:34:51.064578 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:34:51.065091 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:34:51.067193 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:34:51.068717 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m06:34:51.068717 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.069272 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.069272 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:34:51.069272 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m06:34:51.069272 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.071106 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:34:51.071106 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:51.073156 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.074233 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:34:51.076278 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:34:51.076785 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m06:34:51.076785 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m06:34:51.077797 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.079330 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m06:34:51.080036 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF97C590>]}
[0m06:34:51.080036 [info ] [Thread-1 (]: 20 of 98 OK loaded seed file main.seed_dim_risco ............................... [[32mINSERT 10[0m in 0.02s]
[0m06:34:51.081048 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m06:34:51.081048 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:34:51.082179 [info ] [Thread-1 (]: 21 of 98 START seed file main.seed_dim_segmento ................................ [RUN]
[0m06:34:51.082179 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:34:51.082179 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:34:51.083183 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:34:51.085728 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:51.085728 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:34:51.086751 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.086751 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.086751 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:51.086751 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m06:34:51.087870 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.088674 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:51.088674 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:34:51.089684 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.089684 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:51.092240 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:34:51.092240 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:34:51.092240 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:34:51.093289 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.093289 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:34:51.094970 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF9118E0>]}
[0m06:34:51.094970 [info ] [Thread-1 (]: 21 of 98 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.01s]
[0m06:34:51.094970 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:34:51.096797 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:34:51.097323 [info ] [Thread-1 (]: 22 of 98 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m06:34:51.097323 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:34:51.097323 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:34:51.104408 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:34:51.105413 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:34:51.118378 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:34:51.120011 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:34:51.120011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:34:51.120011 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.121015 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.121015 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:34:51.121015 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.122153 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.124402 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:34:51.125692 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:34:51.125692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:34:51.125692 [info ] [Thread-1 (]: 22 of 98 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.03s]
[0m06:34:51.126801 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:34:51.126801 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:34:51.127699 [info ] [Thread-1 (]: 23 of 98 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:34:51.127699 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:34:51.128698 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:34:51.132616 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:34:51.133133 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:34:51.135362 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:34:51.136368 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:34:51.136368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:34:51.136368 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.137368 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.137873 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:34:51.137873 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.138898 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.139904 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:34:51.141410 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:34:51.142012 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:34:51.142012 [info ] [Thread-1 (]: 23 of 98 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:34:51.142012 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:34:51.143556 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:34:51.143556 [info ] [Thread-1 (]: 24 of 98 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:34:51.144562 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:34:51.144562 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:34:51.150633 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:34:51.151967 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:34:51.154479 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:34:51.156525 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:34:51.156525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:34:51.156525 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.157528 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.157528 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:34:51.157528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:51.160523 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.161050 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:34:51.162086 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:34:51.162086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:34:51.163079 [info ] [Thread-1 (]: 24 of 98 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m06:34:51.163612 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:34:51.163612 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:34:51.164626 [info ] [Thread-1 (]: 25 of 98 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:34:51.165130 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:34:51.165130 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:34:51.227364 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:34:51.228732 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:34:51.231672 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:34:51.232206 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:34:51.232206 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:34:51.232206 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.233452 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.234093 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:34:51.234093 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.235412 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.236421 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:34:51.237853 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:34:51.237853 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:34:51.238467 [info ] [Thread-1 (]: 25 of 98 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.07s]
[0m06:34:51.238775 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:34:51.239496 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:34:51.239496 [info ] [Thread-1 (]: 26 of 98 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:34:51.239496 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:34:51.241005 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:34:51.245399 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:34:51.246404 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:34:51.248765 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:34:51.251744 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:34:51.252756 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:34:51.253762 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.254779 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.254779 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:34:51.254779 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.256849 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.257848 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:34:51.259367 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:34:51.259367 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:34:51.259920 [info ] [Thread-1 (]: 26 of 98 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m06:34:51.259920 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:34:51.261043 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:34:51.261043 [info ] [Thread-1 (]: 27 of 98 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:34:51.262047 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:34:51.262047 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:34:51.267248 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:34:51.268282 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:34:51.270931 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:34:51.271953 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:34:51.271953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:34:51.271953 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.271953 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.271953 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:34:51.271953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:51.275077 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.276594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:34:51.277596 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:34:51.277596 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:34:51.278594 [info ] [Thread-1 (]: 27 of 98 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m06:34:51.279594 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:34:51.279594 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:34:51.279594 [info ] [Thread-1 (]: 28 of 98 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:34:51.279594 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:34:51.281268 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:34:51.284216 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:34:51.285258 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:34:51.287800 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:34:51.288333 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:34:51.288333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:34:51.288333 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.289345 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.290851 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:34:51.290851 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.293485 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.295001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:34:51.295001 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:34:51.295001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:34:51.296519 [info ] [Thread-1 (]: 28 of 98 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m06:34:51.297528 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:34:51.298675 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:34:51.298675 [info ] [Thread-1 (]: 29 of 98 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:34:51.301057 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:34:51.301564 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:34:51.308357 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:34:51.308357 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:34:51.315203 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:34:51.316379 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:34:51.316379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:34:51.316979 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.317488 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.317488 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:34:51.318999 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:51.320595 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.322128 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:34:51.323173 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:34:51.323173 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:34:51.323173 [info ] [Thread-1 (]: 29 of 98 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m06:34:51.325119 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:34:51.326134 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:34:51.327130 [info ] [Thread-1 (]: 30 of 98 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:34:51.328130 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:34:51.328130 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:34:51.334242 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:34:51.334803 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:34:51.336469 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:34:51.338503 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:34:51.338503 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:34:51.338503 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.339539 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.339539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:34:51.339539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.341045 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.342067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:34:51.343610 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:34:51.343610 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:34:51.344618 [info ] [Thread-1 (]: 30 of 98 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m06:34:51.346139 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:34:51.346139 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:34:51.346701 [info ] [Thread-1 (]: 31 of 98 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:34:51.346701 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:34:51.346701 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:34:51.350585 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:34:51.351989 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:34:51.354502 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:34:51.355508 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:34:51.355508 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:34:51.356516 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.356516 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.356516 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:34:51.356516 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.358050 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.359606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:34:51.360619 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:34:51.360619 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:34:51.361908 [info ] [Thread-1 (]: 31 of 98 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m06:34:51.361908 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:34:51.361908 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:34:51.363413 [info ] [Thread-1 (]: 32 of 98 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:51.363413 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:34:51.363413 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:34:51.368027 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:34:51.369009 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:34:51.371040 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:34:51.372068 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:34:51.372598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:34:51.372598 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.373604 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.373604 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:34:51.373604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.379914 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:34:51.381953 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:34:51.385052 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:34:51.385752 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:34:51.386782 [info ] [Thread-1 (]: 32 of 98 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:34:51.386782 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:34:51.387763 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:34:51.388405 [info ] [Thread-1 (]: 33 of 98 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:51.388405 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:34:51.389412 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:34:51.396900 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:34:51.399196 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:34:51.402019 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:34:51.404543 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:34:51.405557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:34:51.406569 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.407604 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.408593 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:34:51.408593 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.415361 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:34:51.416634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:34:51.417664 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:34:51.417664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:34:51.417664 [info ] [Thread-1 (]: 33 of 98 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:34:51.417664 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:34:51.419170 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:34:51.419170 [info ] [Thread-1 (]: 34 of 98 START test not_null_fato_capital_prudencial_id_data ................... [RUN]
[0m06:34:51.419170 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m06:34:51.419170 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:34:51.424973 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:34:51.425814 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:34:51.427837 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:34:51.429361 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:34:51.430039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m06:34:51.430039 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.431047 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.431047 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m06:34:51.431553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.432059 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.433572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m06:34:51.434207 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m06:34:51.434207 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m06:34:51.434781 [info ] [Thread-1 (]: 34 of 98 PASS not_null_fato_capital_prudencial_id_data ......................... [[32mPASS[0m in 0.02s]
[0m06:34:51.435493 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m06:34:51.436498 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:34:51.436498 [info ] [Thread-1 (]: 35 of 98 START test not_null_fato_capital_prudencial_id_instituicao ............ [RUN]
[0m06:34:51.437497 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m06:34:51.438078 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:34:51.441194 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:34:51.442240 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:34:51.443446 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:34:51.445215 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:34:51.445215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m06:34:51.445215 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.446728 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.446728 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m06:34:51.447291 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.447801 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.449317 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m06:34:51.449934 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m06:34:51.450941 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m06:34:51.451447 [info ] [Thread-1 (]: 35 of 98 PASS not_null_fato_capital_prudencial_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:34:51.452472 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m06:34:51.452472 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:34:51.452472 [info ] [Thread-1 (]: 36 of 98 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:51.454027 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:34:51.454027 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:34:51.458944 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:34:51.460811 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:34:51.464414 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:34:51.466734 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:34:51.467858 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:34:51.467858 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.468889 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.468889 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:34:51.470079 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.472910 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:51.473424 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:34:51.474936 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:34:51.474936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:34:51.475622 [info ] [Thread-1 (]: 36 of 98 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:34:51.475622 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:34:51.476633 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:34:51.476633 [info ] [Thread-1 (]: 37 of 98 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:51.477664 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:34:51.479177 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:34:51.486625 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:34:51.488356 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:34:51.491551 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:34:51.492066 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:34:51.492066 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:34:51.493774 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.494836 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.495406 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:34:51.495965 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.505574 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m06:34:51.506594 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:34:51.507129 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:34:51.507129 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:34:51.508139 [info ] [Thread-1 (]: 37 of 98 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:34:51.508139 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:34:51.509645 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:34:51.510195 [info ] [Thread-1 (]: 38 of 98 START test not_null_fato_carteira_credito_indexador_id_data ........... [RUN]
[0m06:34:51.510739 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m06:34:51.511747 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:34:51.517596 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:34:51.519103 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:34:51.524593 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:34:51.526731 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:34:51.527733 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m06:34:51.528559 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.528559 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.530086 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m06:34:51.530086 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.531092 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.532759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m06:34:51.533301 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m06:34:51.534038 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m06:34:51.534733 [info ] [Thread-1 (]: 38 of 98 PASS not_null_fato_carteira_credito_indexador_id_data ................. [[32mPASS[0m in 0.02s]
[0m06:34:51.535322 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m06:34:51.535322 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:34:51.535322 [info ] [Thread-1 (]: 39 of 98 START test not_null_fato_carteira_credito_indexador_id_instituicao .... [RUN]
[0m06:34:51.536327 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m06:34:51.536327 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:34:51.541878 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:34:51.542480 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:34:51.545393 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:34:51.546611 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:34:51.547273 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m06:34:51.547273 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.548144 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.548144 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m06:34:51.548654 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.549799 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.551496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m06:34:51.553039 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m06:34:51.554231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m06:34:51.554893 [info ] [Thread-1 (]: 39 of 98 PASS not_null_fato_carteira_credito_indexador_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:34:51.556013 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m06:34:51.556013 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:34:51.556013 [info ] [Thread-1 (]: 40 of 98 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:51.557167 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:34:51.557824 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:34:51.563775 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:34:51.564311 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:34:51.566928 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:34:51.567466 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:34:51.567466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:34:51.567466 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.568991 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.568991 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:34:51.568991 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.571012 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.572134 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:34:51.573144 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:34:51.573144 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:34:51.573144 [info ] [Thread-1 (]: 40 of 98 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:34:51.574660 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:34:51.574660 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:34:51.575666 [info ] [Thread-1 (]: 41 of 98 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:51.575666 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:34:51.576784 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:34:51.580434 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:34:51.581455 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:34:51.583111 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:34:51.583778 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:34:51.583778 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:34:51.583778 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.585322 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.585322 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:34:51.586343 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.589417 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:34:51.590940 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:34:51.592628 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:34:51.593635 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:34:51.593635 [info ] [Thread-1 (]: 41 of 98 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:51.594710 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:34:51.594710 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:34:51.595766 [info ] [Thread-1 (]: 42 of 98 START test not_null_fato_carteira_credito_totais_id_data .............. [RUN]
[0m06:34:51.596280 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m06:34:51.596851 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:34:51.599919 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:34:51.600960 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:34:51.603513 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:34:51.605719 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:34:51.606602 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m06:34:51.607684 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.608242 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.609757 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m06:34:51.610920 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.612725 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.615032 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m06:34:51.615542 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m06:34:51.616114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m06:34:51.616652 [info ] [Thread-1 (]: 42 of 98 PASS not_null_fato_carteira_credito_totais_id_data .................... [[32mPASS[0m in 0.02s]
[0m06:34:51.617195 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m06:34:51.617712 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:34:51.618241 [info ] [Thread-1 (]: 43 of 98 START test not_null_fato_carteira_credito_totais_id_instituicao ....... [RUN]
[0m06:34:51.618751 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m06:34:51.618751 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:34:51.621974 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:34:51.623601 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:34:51.627115 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:34:51.628360 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:34:51.628891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m06:34:51.628891 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.629915 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.630451 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m06:34:51.630451 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.630989 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.632500 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m06:34:51.633559 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m06:34:51.633559 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m06:34:51.634160 [info ] [Thread-1 (]: 43 of 98 PASS not_null_fato_carteira_credito_totais_id_instituicao ............. [[32mPASS[0m in 0.02s]
[0m06:34:51.634762 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m06:34:51.635290 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:34:51.635290 [info ] [Thread-1 (]: 44 of 98 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:51.636301 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:34:51.637343 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:34:51.642107 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:34:51.643130 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:34:51.644862 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:34:51.647127 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:34:51.647127 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:34:51.647127 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.647127 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.647127 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:34:51.648746 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.650426 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.653420 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:34:51.653946 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:34:51.653946 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:34:51.653946 [info ] [Thread-1 (]: 44 of 98 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:34:51.655569 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:34:51.656582 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:34:51.656582 [info ] [Thread-1 (]: 45 of 98 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:51.656582 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:34:51.657606 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:34:51.660649 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:34:51.662177 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:34:51.664378 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:34:51.666415 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:34:51.667041 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:34:51.667041 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.668053 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.670608 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:34:51.671137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.674919 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:34:51.675546 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:34:51.676552 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:34:51.677553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:34:51.677553 [info ] [Thread-1 (]: 45 of 98 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:51.679053 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:34:51.679358 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:34:51.679861 [info ] [Thread-1 (]: 46 of 98 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m06:34:51.679861 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m06:34:51.679861 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:34:51.683807 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:34:51.684822 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:34:51.686338 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:34:51.688490 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:34:51.688490 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m06:34:51.688490 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.689497 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.689497 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m06:34:51.689497 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.689497 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.692034 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m06:34:51.692034 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m06:34:51.692034 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m06:34:51.693646 [info ] [Thread-1 (]: 46 of 98 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m06:34:51.694162 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m06:34:51.694673 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:34:51.694673 [info ] [Thread-1 (]: 47 of 98 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m06:34:51.694673 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m06:34:51.694673 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:34:51.699012 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:34:51.699687 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:34:51.702862 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:34:51.704392 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:34:51.704392 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m06:34:51.704392 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.705421 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.705421 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m06:34:51.705421 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.706450 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.707450 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m06:34:51.707450 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m06:34:51.708449 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m06:34:51.708449 [info ] [Thread-1 (]: 47 of 98 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.01s]
[0m06:34:51.709433 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m06:34:51.709935 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:34:51.709935 [info ] [Thread-1 (]: 48 of 98 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:51.710761 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:34:51.710761 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:34:51.716530 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:34:51.717034 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:34:51.719567 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:34:51.720572 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:34:51.720572 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:34:51.720572 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.722257 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.722257 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:34:51.722785 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.726315 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:51.727320 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:34:51.728316 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:34:51.728316 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:34:51.728316 [info ] [Thread-1 (]: 48 of 98 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:34:51.729873 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:34:51.729873 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:34:51.729873 [info ] [Thread-1 (]: 49 of 98 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:51.729873 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:34:51.729873 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:34:51.736388 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:34:51.737926 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:34:51.738597 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:34:51.739699 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:34:51.739699 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:34:51.739699 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.741205 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.741205 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:34:51.741205 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.747054 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:34:51.748739 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:34:51.748739 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:34:51.749746 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:34:51.750251 [info ] [Thread-1 (]: 49 of 98 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:51.750755 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:34:51.751489 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:34:51.751489 [info ] [Thread-1 (]: 50 of 98 START test not_null_fato_movimentacao_cambio_id_data .................. [RUN]
[0m06:34:51.752496 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m06:34:51.752496 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:34:51.755664 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:34:51.755664 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:34:51.758176 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:34:51.759182 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:34:51.759182 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m06:34:51.759182 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.760183 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.760688 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m06:34:51.760688 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.760688 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.763357 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m06:34:51.764583 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m06:34:51.764583 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m06:34:51.764583 [info ] [Thread-1 (]: 50 of 98 PASS not_null_fato_movimentacao_cambio_id_data ........................ [[32mPASS[0m in 0.01s]
[0m06:34:51.765588 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m06:34:51.766205 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:34:51.766511 [info ] [Thread-1 (]: 51 of 98 START test not_null_fato_movimentacao_cambio_id_instituicao ........... [RUN]
[0m06:34:51.767059 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m06:34:51.767059 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:34:51.769315 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:34:51.770907 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:34:51.772536 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:34:51.773043 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:34:51.774050 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m06:34:51.774050 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.774556 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.774556 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m06:34:51.775313 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.776319 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.777319 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m06:34:51.777319 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m06:34:51.778420 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m06:34:51.778420 [info ] [Thread-1 (]: 51 of 98 PASS not_null_fato_movimentacao_cambio_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m06:34:51.779431 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m06:34:51.779936 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:34:51.779936 [info ] [Thread-1 (]: 52 of 98 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:51.780941 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:34:51.780941 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:34:51.785483 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:34:51.786490 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:34:51.789980 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:34:51.790989 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:34:51.790989 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:34:51.790989 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.791996 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.792501 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:34:51.792501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.793507 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.796207 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:34:51.796803 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:34:51.796803 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:34:51.797538 [info ] [Thread-1 (]: 52 of 98 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:34:51.798677 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:34:51.798677 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:34:51.799379 [info ] [Thread-1 (]: 53 of 98 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:51.799379 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:34:51.799379 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:34:51.804055 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:34:51.804055 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:34:51.806530 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:34:51.806530 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:34:51.807537 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:34:51.807537 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.807537 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.808538 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:34:51.808538 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.812070 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:51.814628 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:34:51.815825 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:34:51.815825 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:34:51.815825 [info ] [Thread-1 (]: 53 of 98 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:51.816947 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:34:51.816947 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:34:51.818020 [info ] [Thread-1 (]: 54 of 98 START test not_null_fato_operacoes_clientes_id_data ................... [RUN]
[0m06:34:51.818020 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m06:34:51.819052 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:34:51.820765 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:34:51.822517 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:34:51.824761 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:34:51.826398 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:34:51.826398 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m06:34:51.826398 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.826398 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.827397 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m06:34:51.827397 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.828416 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.829398 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m06:34:51.829961 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m06:34:51.829961 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m06:34:51.830974 [info ] [Thread-1 (]: 54 of 98 PASS not_null_fato_operacoes_clientes_id_data ......................... [[32mPASS[0m in 0.01s]
[0m06:34:51.830974 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m06:34:51.830974 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:34:51.832209 [info ] [Thread-1 (]: 55 of 98 START test not_null_fato_operacoes_clientes_id_instituicao ............ [RUN]
[0m06:34:51.832209 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m06:34:51.833240 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:34:51.835461 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:34:51.837479 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:34:51.838644 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:34:51.840150 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:34:51.841157 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m06:34:51.841157 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.841157 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.842212 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m06:34:51.842212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.842822 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.843327 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m06:34:51.843327 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m06:34:51.845205 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m06:34:51.845205 [info ] [Thread-1 (]: 55 of 98 PASS not_null_fato_operacoes_clientes_id_instituicao .................. [[32mPASS[0m in 0.01s]
[0m06:34:51.845205 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m06:34:51.846589 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:34:51.847141 [info ] [Thread-1 (]: 56 of 98 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:51.847141 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:34:51.847141 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:34:51.851250 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:34:51.852224 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:34:51.853922 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:34:51.853922 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:34:51.853922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:34:51.853922 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.855599 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.855599 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:34:51.856612 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.858613 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.860120 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:34:51.860722 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:34:51.860722 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:34:51.861751 [info ] [Thread-1 (]: 56 of 98 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:34:51.861751 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:34:51.861751 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:34:51.861751 [info ] [Thread-1 (]: 57 of 98 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:51.863282 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:34:51.863282 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:34:51.869079 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:34:51.869079 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:34:51.872390 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:34:51.873419 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:34:51.873419 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:34:51.874927 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.875552 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.875552 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:34:51.876079 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.879091 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:34:51.880161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:34:51.881850 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:34:51.881850 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:34:51.881850 [info ] [Thread-1 (]: 57 of 98 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:51.882885 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:34:51.883448 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:34:51.883997 [info ] [Thread-1 (]: 58 of 98 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m06:34:51.883997 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m06:34:51.885009 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:34:51.888459 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:34:51.889469 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:34:51.890989 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:34:51.892003 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:34:51.892003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m06:34:51.892003 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.892003 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.892003 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m06:34:51.892003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.893576 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.895365 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m06:34:51.896372 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m06:34:51.896372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m06:34:51.896894 [info ] [Thread-1 (]: 58 of 98 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.01s]
[0m06:34:51.896894 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m06:34:51.897909 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:34:51.897909 [info ] [Thread-1 (]: 59 of 98 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m06:34:51.898907 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m06:34:51.898907 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:34:51.901799 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:34:51.902814 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:34:51.904319 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:34:51.905324 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:34:51.905915 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m06:34:51.905915 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.906428 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.906428 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m06:34:51.906428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.907436 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.908915 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m06:34:51.909915 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m06:34:51.909915 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m06:34:51.910422 [info ] [Thread-1 (]: 59 of 98 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m06:34:51.911040 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m06:34:51.911040 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:34:51.912045 [info ] [Thread-1 (]: 60 of 98 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:34:51.912045 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:34:51.913061 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:34:51.916494 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:34:51.917567 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:34:51.920089 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:34:51.921126 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:34:51.921126 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:34:51.922277 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.922277 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.922277 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:34:51.923283 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.925584 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:51.926604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:34:51.926604 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:34:51.927611 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:34:51.928137 [info ] [Thread-1 (]: 60 of 98 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:34:51.928137 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:34:51.928137 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:34:51.929150 [info ] [Thread-1 (]: 61 of 98 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:34:51.929655 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:34:51.929655 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:34:51.933219 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:34:51.934458 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:34:51.936527 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:34:51.937531 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:34:51.938151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:34:51.938151 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.938743 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.939250 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:34:51.939250 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:51.947189 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m06:34:51.949504 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:34:51.950617 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:34:51.950617 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:34:51.951526 [info ] [Thread-1 (]: 61 of 98 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:34:51.952031 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:34:51.952031 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m06:34:51.952031 [info ] [Thread-1 (]: 62 of 98 START sql table model main.dim_atividade .............................. [RUN]
[0m06:34:51.953037 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m06:34:51.953037 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m06:34:51.956803 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:34:51.957913 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m06:34:51.960509 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m06:34:51.960509 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:34:51.961617 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m06:34:51.961617 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:51.961617 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.961617 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:34:51.963124 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m06:34:51.963124 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.966934 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:34:51.966934 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m06:34:51.967963 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.968966 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:34:51.968966 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:34:51.969499 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m06:34:51.970514 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:51.972061 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m06:34:51.972589 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m06:34:51.973114 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:51.974143 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m06:34:51.974660 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF984A10>]}
[0m06:34:52.905700 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m06:34:52.907245 [info ] [Thread-1 (]: 62 of 98 OK created sql table model main.dim_atividade ......................... [[32mOK[0m in 0.02s]
[0m06:34:52.907245 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m06:34:52.908739 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:34:52.908739 [info ] [Thread-1 (]: 63 of 98 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:34:52.908739 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:34:52.909744 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:34:52.911832 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:34:52.914872 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:34:52.917888 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:34:52.918890 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:34:52.918890 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:34:52.918890 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:52.918890 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.920549 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:34:52.920549 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:34:52.922468 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.923582 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:34:52.924876 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:34:52.925764 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.925764 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:34:52.926770 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:34:52.926770 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:34:52.928027 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.930037 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:34:52.930540 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:34:52.931041 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.932047 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:34:52.932552 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF9601D0>]}
[0m06:34:52.933329 [info ] [Thread-1 (]: 63 of 98 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.02s]
[0m06:34:52.933329 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:34:52.934352 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:34:52.934352 [info ] [Thread-1 (]: 64 of 98 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:34:52.935613 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:34:52.936161 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:34:52.938446 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:52.938446 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:34:52.943167 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:52.944677 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:52.944677 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:34:52.945183 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:52.945183 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.946188 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:52.946188 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:34:52.946849 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.949011 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:52.949648 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:34:52.949648 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.951159 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:34:52.951159 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:52.951836 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:34:52.951836 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.953866 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:34:52.953866 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:34:52.955453 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.957460 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:34:52.957460 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBB73E60>]}
[0m06:34:52.958460 [info ] [Thread-1 (]: 64 of 98 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.02s]
[0m06:34:52.958460 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:34:52.958460 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:34:52.959964 [info ] [Thread-1 (]: 65 of 98 START sql table model main.dim_controle ............................... [RUN]
[0m06:34:52.960547 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:34:52.960547 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:34:52.961560 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:52.963603 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:34:52.965640 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:52.966759 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:52.966759 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:34:52.966759 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:52.967766 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.967766 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:52.967766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:34:52.969273 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.970874 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:52.970874 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:34:52.972613 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.974547 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:34:52.975145 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:52.975145 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:34:52.976152 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.978253 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:34:52.978253 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:34:52.979274 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.980060 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:34:52.980060 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E69528A0>]}
[0m06:34:52.980060 [info ] [Thread-1 (]: 65 of 98 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.02s]
[0m06:34:52.981168 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:34:52.981168 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:34:52.982274 [info ] [Thread-1 (]: 66 of 98 START sql table model main.dim_faixa_vencimento ....................... [RUN]
[0m06:34:52.982778 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m06:34:52.982778 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:34:52.984844 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:34:52.985392 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:34:52.989857 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:34:52.990859 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:34:52.990859 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m06:34:52.990859 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:52.990859 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.990859 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:34:52.992553 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m06:34:52.993102 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.994781 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:34:52.994781 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m06:34:52.994781 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:52.996901 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:34:52.996901 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:34:52.996901 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m06:34:52.997904 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:52.999760 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m06:34:53.000772 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m06:34:53.001457 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.001457 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m06:34:53.002479 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EB032D50>]}
[0m06:34:53.003462 [info ] [Thread-1 (]: 66 of 98 OK created sql table model main.dim_faixa_vencimento .................. [[32mOK[0m in 0.02s]
[0m06:34:53.003967 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m06:34:53.003967 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m06:34:53.003967 [info ] [Thread-1 (]: 67 of 98 START sql table model main.dim_porte .................................. [RUN]
[0m06:34:53.005550 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m06:34:53.005550 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m06:34:53.008088 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:34:53.009599 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m06:34:53.012001 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m06:34:53.012001 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:34:53.012001 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m06:34:53.012001 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.013506 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.013506 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:34:53.013506 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m06:34:53.014527 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.017152 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:34:53.017152 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m06:34:53.017658 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.019213 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:34:53.019213 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:34:53.019213 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m06:34:53.020939 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.022493 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m06:34:53.022493 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m06:34:53.022493 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.023501 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m06:34:53.024520 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF994C80>]}
[0m06:34:53.025043 [info ] [Thread-1 (]: 67 of 98 OK created sql table model main.dim_porte ............................. [[32mOK[0m in 0.02s]
[0m06:34:53.025043 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m06:34:53.026055 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:34:53.026055 [info ] [Thread-1 (]: 68 of 98 START sql table model main.dim_produto_credito ........................ [RUN]
[0m06:34:53.026055 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m06:34:53.027055 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:34:53.029283 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:34:53.030420 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:34:53.033019 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:34:53.033019 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:34:53.034414 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m06:34:53.034414 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.034414 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.035417 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:34:53.035417 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m06:34:53.035919 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.038424 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:34:53.039933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m06:34:53.040940 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.041951 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:34:53.041951 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:34:53.041951 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m06:34:53.043465 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.045141 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m06:34:53.045141 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m06:34:53.047160 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.047160 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m06:34:53.048773 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002218BDE24E0>]}
[0m06:34:53.049477 [info ] [Thread-1 (]: 68 of 98 OK created sql table model main.dim_produto_credito ................... [[32mOK[0m in 0.02s]
[0m06:34:53.050486 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m06:34:53.050990 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m06:34:53.051651 [info ] [Thread-1 (]: 69 of 98 START sql table model main.dim_regiao ................................. [RUN]
[0m06:34:53.052659 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m06:34:53.053657 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m06:34:53.056673 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:34:53.057674 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m06:34:53.060179 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m06:34:53.060684 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:34:53.060684 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m06:34:53.061690 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.061690 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.061690 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:34:53.062690 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m06:34:53.063688 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.065801 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:34:53.065801 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m06:34:53.066836 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.068100 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:34:53.068100 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:34:53.068100 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m06:34:53.069637 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.071169 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m06:34:53.071169 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m06:34:53.072180 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.072708 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m06:34:53.073229 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EB735E80>]}
[0m06:34:53.073229 [info ] [Thread-1 (]: 69 of 98 OK created sql table model main.dim_regiao ............................ [[32mOK[0m in 0.02s]
[0m06:34:53.073229 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m06:34:53.074871 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m06:34:53.074871 [info ] [Thread-1 (]: 70 of 98 START sql table model main.dim_risco .................................. [RUN]
[0m06:34:53.075504 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m06:34:53.075504 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m06:34:53.077526 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:34:53.079052 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m06:34:53.082176 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m06:34:53.083729 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:34:53.083729 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m06:34:53.084415 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.084415 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.084415 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:34:53.085442 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m06:34:53.085984 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.088487 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:34:53.088487 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m06:34:53.088993 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.090512 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:34:53.090512 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:34:53.091033 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m06:34:53.092056 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.093572 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m06:34:53.095375 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m06:34:53.096628 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.097211 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m06:34:53.097211 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002218BDFC110>]}
[0m06:34:53.098841 [info ] [Thread-1 (]: 70 of 98 OK created sql table model main.dim_risco ............................. [[32mOK[0m in 0.02s]
[0m06:34:53.099413 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m06:34:53.099413 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:34:53.099413 [info ] [Thread-1 (]: 71 of 98 START sql table model main.dim_segmento ............................... [RUN]
[0m06:34:53.101084 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:34:53.101084 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:34:53.102287 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:53.103839 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:34:53.106724 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:53.107709 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:53.107709 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:34:53.107709 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.108707 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.108707 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:53.108707 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:34:53.109729 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.111956 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:53.113459 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:34:53.113459 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.114992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:34:53.114992 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:53.115515 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:34:53.116551 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.118105 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:34:53.118105 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:34:53.119104 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.119104 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:34:53.120780 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EB6B9070>]}
[0m06:34:53.120780 [info ] [Thread-1 (]: 71 of 98 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.02s]
[0m06:34:53.120780 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:34:53.120780 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:34:53.122435 [info ] [Thread-1 (]: 72 of 98 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:34:53.122435 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:34:53.122435 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:34:53.126305 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:34:53.127309 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:34:53.129309 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:34:53.130224 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:34:53.130908 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:34:53.130908 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.131917 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.131917 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:34:53.131917 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:34:53.133428 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.133965 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:34:53.134972 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:34:53.135477 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:34:53.135477 [info ] [Thread-1 (]: 72 of 98 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m06:34:53.135477 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:34:53.137002 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:34:53.137002 [info ] [Thread-1 (]: 73 of 98 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:34:53.137513 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:34:53.137513 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:34:53.140960 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:34:53.142803 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:34:53.143335 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:34:53.144880 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:34:53.144880 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:34:53.144880 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.146517 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.147062 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:34:53.147062 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:53.148582 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.149678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:34:53.150856 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:34:53.150856 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:34:53.151372 [info ] [Thread-1 (]: 73 of 98 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:34:53.151372 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:34:53.152407 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:34:53.152407 [info ] [Thread-1 (]: 74 of 98 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:34:53.152407 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:34:53.152407 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:34:53.155540 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:34:53.157547 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:34:53.162296 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:34:53.163301 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:34:53.163301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:34:53.163301 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.164306 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.164306 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:34:53.164306 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:53.167018 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:34:53.168039 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:34:53.169022 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:34:53.169022 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:34:53.170270 [info ] [Thread-1 (]: 74 of 98 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m06:34:53.170814 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:34:53.170814 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:34:53.170814 [info ] [Thread-1 (]: 75 of 98 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:34:53.170814 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:34:53.172463 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:34:53.176910 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:34:53.177912 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:34:53.180074 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:34:53.180619 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:34:53.181161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:34:53.181161 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.181773 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.181773 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:34:53.181773 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:34:53.182802 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.183937 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:34:53.183937 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:34:53.184963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:34:53.184963 [info ] [Thread-1 (]: 75 of 98 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:34:53.185595 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:34:53.186625 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:34:53.186625 [info ] [Thread-1 (]: 76 of 98 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:34:53.188133 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:34:53.188743 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:34:53.192379 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:34:53.192379 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:34:53.193918 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:34:53.194941 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:34:53.194941 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:34:53.195953 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.196483 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.196483 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:34:53.196483 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:53.197144 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.199995 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:34:53.199995 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:34:53.201027 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:34:53.201334 [info ] [Thread-1 (]: 76 of 98 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m06:34:53.201854 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:34:53.202385 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:34:53.202385 [info ] [Thread-1 (]: 77 of 98 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:34:53.202385 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:34:53.202385 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:34:53.205635 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:34:53.206643 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:34:53.208643 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:34:53.210153 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:34:53.210659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:34:53.210659 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.211666 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.211666 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:34:53.211666 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:53.213173 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.214796 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:34:53.215587 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:34:53.215587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:34:53.215587 [info ] [Thread-1 (]: 77 of 98 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:34:53.216650 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:34:53.216650 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:34:53.216650 [info ] [Thread-1 (]: 78 of 98 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:34:53.217956 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:34:53.217956 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:34:53.220765 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:34:53.220765 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:34:53.223037 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:34:53.225081 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:34:53.225081 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:34:53.225649 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.225649 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.225649 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:34:53.226780 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:34:53.227658 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.227658 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:34:53.229272 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:34:53.229272 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:34:53.230173 [info ] [Thread-1 (]: 78 of 98 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:34:53.230499 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:34:53.231140 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:34:53.231140 [info ] [Thread-1 (]: 79 of 98 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:34:53.231140 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:34:53.232174 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:34:53.237909 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:34:53.238700 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:34:53.239707 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:34:53.241212 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:34:53.241212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:34:53.241212 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.242220 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.242726 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:34:53.242726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:34:53.243745 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.245255 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:34:53.246262 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:34:53.246262 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:34:53.247117 [info ] [Thread-1 (]: 79 of 98 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m06:34:53.247622 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:34:53.247622 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:34:53.248628 [info ] [Thread-1 (]: 80 of 98 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:34:53.249267 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:34:53.249570 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:34:53.252667 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:34:53.253666 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:34:53.254171 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:34:53.255681 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:34:53.255681 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:34:53.256686 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.256686 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.257715 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:34:53.257715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:34:53.258685 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:34:53.260902 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:34:53.261907 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:34:53.262409 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:34:53.262409 [info ] [Thread-1 (]: 80 of 98 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:34:53.263411 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:34:53.263411 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:34:53.264415 [info ] [Thread-1 (]: 81 of 98 START sql table model main.fato_carteira_credito_atividade ............ [RUN]
[0m06:34:53.264918 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m06:34:53.264918 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:34:53.268204 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:34:53.269729 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:34:53.273308 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:34:53.273838 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:34:53.274844 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m06:34:53.274844 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:34:53.275449 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:34:53.275449 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:34:53.275449 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:35:00.773471 [debug] [Thread-1 (]: SQL status: OK in 7.498 seconds
[0m06:35:00.776099 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:35:00.776099 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m06:35:00.777115 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:00.778099 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:35:00.778099 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:35:00.778099 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m06:35:00.901003 [debug] [Thread-1 (]: SQL status: OK in 0.122 seconds
[0m06:35:00.903192 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m06:35:00.903717 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m06:35:00.904228 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:00.904228 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m06:35:00.905746 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EBB721B0>]}
[0m06:35:00.905746 [info ] [Thread-1 (]: 81 of 98 OK created sql table model main.fato_carteira_credito_atividade ....... [[32mOK[0m in 7.64s]
[0m06:35:00.906752 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m06:35:00.906752 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:35:00.906752 [info ] [Thread-1 (]: 82 of 98 START sql table model main.fato_carteira_credito_porte ................ [RUN]
[0m06:35:00.907752 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m06:35:00.907752 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:35:00.910792 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:35:00.911818 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:35:00.917058 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:35:00.919069 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:35:00.919796 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m06:35:00.919796 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:00.920861 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:00.920861 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:35:00.920861 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:35:01.061633 [debug] [Thread-1 (]: SQL status: OK in 0.141 seconds
[0m06:35:01.065197 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:35:01.065197 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m06:35:01.065701 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:01.066995 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:35:01.066995 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:35:01.066995 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m06:35:01.073440 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:35:01.075170 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m06:35:01.076199 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m06:35:01.076199 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:01.077197 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m06:35:01.077197 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002218BE3DAF0>]}
[0m06:35:01.078196 [info ] [Thread-1 (]: 82 of 98 OK created sql table model main.fato_carteira_credito_porte ........... [[32mOK[0m in 0.17s]
[0m06:35:01.078196 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m06:35:01.079184 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:35:01.079687 [info ] [Thread-1 (]: 83 of 98 START sql table model main.fato_carteira_credito_produto .............. [RUN]
[0m06:35:01.079687 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m06:35:01.079687 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:35:01.083843 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:35:01.084847 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:35:01.086396 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:35:01.087898 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:35:01.088438 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m06:35:01.088438 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:01.088438 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:01.088438 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:35:01.088438 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m06:35:12.045447 [debug] [Thread-1 (]: SQL status: OK in 10.955 seconds
[0m06:35:12.047441 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:35:12.047441 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m06:35:12.048455 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.049023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:35:12.049023 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:35:12.049023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m06:35:12.075458 [debug] [Thread-1 (]: SQL status: OK in 0.027 seconds
[0m06:35:12.077479 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m06:35:12.078992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m06:35:12.078992 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.080042 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m06:35:12.080042 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221EB3631D0>]}
[0m06:35:12.081203 [info ] [Thread-1 (]: 83 of 98 OK created sql table model main.fato_carteira_credito_produto ......... [[32mOK[0m in 11.00s]
[0m06:35:12.081203 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m06:35:12.081203 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:35:12.082668 [info ] [Thread-1 (]: 84 of 98 START sql table model main.fato_regiao_credito ........................ [RUN]
[0m06:35:12.083435 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m06:35:12.083435 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:35:12.086528 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:35:12.087527 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:35:12.089621 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:35:12.089621 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:35:12.091132 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m06:35:12.091132 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.092142 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.092644 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:35:12.092644 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:35:12.299195 [debug] [Thread-1 (]: SQL status: OK in 0.206 seconds
[0m06:35:12.303039 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:35:12.303039 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m06:35:12.303039 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.304546 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:35:12.305050 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:35:12.305050 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m06:35:12.312893 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:35:12.314494 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m06:35:12.314494 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m06:35:12.315508 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.316519 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m06:35:12.317042 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002218BE36F60>]}
[0m06:35:12.317042 [info ] [Thread-1 (]: 84 of 98 OK created sql table model main.fato_regiao_credito ................... [[32mOK[0m in 0.23s]
[0m06:35:12.318048 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m06:35:12.318048 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:35:12.318048 [info ] [Thread-1 (]: 85 of 98 START sql table model main.fato_risco_credito ......................... [RUN]
[0m06:35:12.319080 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m06:35:12.319080 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:35:12.322540 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:35:12.323042 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:35:12.325949 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:35:12.327956 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:35:12.327956 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m06:35:12.327956 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.327956 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.327956 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:35:12.329510 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m06:35:12.658922 [debug] [Thread-1 (]: SQL status: OK in 0.329 seconds
[0m06:35:12.662119 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:35:12.663120 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m06:35:12.663120 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.664745 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:35:12.664745 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:35:12.664745 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m06:35:12.733494 [debug] [Thread-1 (]: SQL status: OK in 0.068 seconds
[0m06:35:12.736799 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m06:35:12.737806 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m06:35:12.738398 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.740937 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m06:35:12.741954 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221FF91DD60>]}
[0m06:35:12.743079 [info ] [Thread-1 (]: 85 of 98 OK created sql table model main.fato_risco_credito .................... [[32mOK[0m in 0.42s]
[0m06:35:12.744631 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m06:35:12.744631 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:35:12.746151 [info ] [Thread-1 (]: 86 of 98 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:35:12.747308 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:35:12.748321 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:35:12.754459 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:35:12.755460 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:35:12.759488 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:35:12.760596 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:35:12.761626 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:35:12.761626 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.763134 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.763134 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:35:12.763134 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.764712 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.766454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:35:12.767605 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:35:12.769273 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:35:12.769824 [info ] [Thread-1 (]: 86 of 98 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.02s]
[0m06:35:12.770862 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:35:12.771937 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:35:12.771937 [info ] [Thread-1 (]: 87 of 98 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:35:12.771937 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:35:12.773645 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:35:12.779737 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:35:12.782999 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:35:12.788331 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:35:12.789343 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:35:12.790359 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:35:12.790882 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.790882 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.791911 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:35:12.791911 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.795110 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:35:12.797277 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:35:12.797277 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:35:12.798837 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:35:12.799467 [info ] [Thread-1 (]: 87 of 98 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.03s]
[0m06:35:12.801063 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:35:12.801063 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:35:12.801768 [info ] [Thread-1 (]: 88 of 98 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:35:12.802779 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:35:12.802779 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:35:12.807419 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:35:12.809420 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:35:12.812025 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:35:12.813002 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:35:12.813002 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:35:12.814687 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.816302 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.816918 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:35:12.816918 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:35:12.818929 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:35:12.820518 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:35:12.823192 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:35:12.823192 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:35:12.824799 [info ] [Thread-1 (]: 88 of 98 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m06:35:12.825826 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:35:12.825826 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:35:12.826829 [info ] [Thread-1 (]: 89 of 98 START test not_null_fato_carteira_credito_atividade_id_instituicao .... [RUN]
[0m06:35:12.827831 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m06:35:12.827831 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:35:12.834663 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:35:12.836273 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:35:12.839632 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:35:12.841117 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:35:12.842137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m06:35:12.842137 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.842137 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.843377 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m06:35:12.843377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.843377 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.846585 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m06:35:12.847268 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m06:35:12.847268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m06:35:12.849526 [info ] [Thread-1 (]: 89 of 98 PASS not_null_fato_carteira_credito_atividade_id_instituicao .......... [[32mPASS[0m in 0.02s]
[0m06:35:12.849526 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m06:35:12.850885 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:35:12.851606 [info ] [Thread-1 (]: 90 of 98 START test not_null_fato_carteira_credito_porte_id_instituicao ........ [RUN]
[0m06:35:12.851606 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m06:35:12.852635 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:35:12.855547 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:35:12.858707 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:35:12.861221 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:35:12.863754 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:35:12.864276 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m06:35:12.864276 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.864276 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.865981 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m06:35:12.865981 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.867010 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.869078 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m06:35:12.870768 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m06:35:12.871772 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m06:35:12.872291 [info ] [Thread-1 (]: 90 of 98 PASS not_null_fato_carteira_credito_porte_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m06:35:12.873314 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m06:35:12.873314 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:35:12.873314 [info ] [Thread-1 (]: 91 of 98 START test not_null_fato_carteira_credito_produto_id_data ............. [RUN]
[0m06:35:12.874526 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m06:35:12.874526 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:35:12.879240 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:35:12.881132 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:35:12.882170 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:35:12.885480 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:35:12.885480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m06:35:12.886508 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.887490 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.888164 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m06:35:12.888863 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.889893 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.890893 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m06:35:12.892551 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m06:35:12.892551 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m06:35:12.893121 [info ] [Thread-1 (]: 91 of 98 PASS not_null_fato_carteira_credito_produto_id_data ................... [[32mPASS[0m in 0.02s]
[0m06:35:12.893121 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m06:35:12.893121 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:35:12.894646 [info ] [Thread-1 (]: 92 of 98 START test not_null_fato_carteira_credito_produto_id_instituicao ...... [RUN]
[0m06:35:12.894646 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m06:35:12.894646 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:35:12.899648 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:35:12.901389 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:35:12.903007 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:35:12.905084 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:35:12.905084 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m06:35:12.905648 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.905648 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.905648 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m06:35:12.905648 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.906757 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.907770 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m06:35:12.908654 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m06:35:12.908654 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m06:35:12.909755 [info ] [Thread-1 (]: 92 of 98 PASS not_null_fato_carteira_credito_produto_id_instituicao ............ [[32mPASS[0m in 0.02s]
[0m06:35:12.909755 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m06:35:12.910870 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:35:12.910870 [info ] [Thread-1 (]: 93 of 98 START test not_null_fato_regiao_credito_id_instituicao ................ [RUN]
[0m06:35:12.911878 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m06:35:12.911878 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:35:12.915584 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:35:12.916590 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:35:12.917717 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:35:12.919223 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:35:12.919223 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m06:35:12.919223 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.921013 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.921013 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m06:35:12.921013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.922137 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.923609 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m06:35:12.923609 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m06:35:12.923609 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m06:35:12.924795 [info ] [Thread-1 (]: 93 of 98 PASS not_null_fato_regiao_credito_id_instituicao ...................... [[32mPASS[0m in 0.01s]
[0m06:35:12.925407 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m06:35:12.925407 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:35:12.925407 [info ] [Thread-1 (]: 94 of 98 START test not_null_fato_regiao_credito_id_regiao ..................... [RUN]
[0m06:35:12.926460 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m06:35:12.927414 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:35:12.930042 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:35:12.931065 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:35:12.933363 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:35:12.934885 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:35:12.935416 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m06:35:12.935416 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.936426 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.936426 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m06:35:12.936426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.937932 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.938677 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m06:35:12.939782 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m06:35:12.939782 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m06:35:12.941025 [info ] [Thread-1 (]: 94 of 98 PASS not_null_fato_regiao_credito_id_regiao ........................... [[32mPASS[0m in 0.01s]
[0m06:35:12.941331 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m06:35:12.941331 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:35:12.941331 [info ] [Thread-1 (]: 95 of 98 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m06:35:12.942370 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m06:35:12.942370 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:35:12.946748 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:35:12.947427 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:35:12.949536 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:35:12.951763 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:35:12.952268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m06:35:12.952268 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.952268 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.952268 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m06:35:12.952268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.955533 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:35:12.956598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m06:35:12.957650 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m06:35:12.957650 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m06:35:12.958642 [info ] [Thread-1 (]: 95 of 98 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.02s]
[0m06:35:12.959539 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m06:35:12.959539 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:35:12.960043 [info ] [Thread-1 (]: 96 of 98 START test not_null_fato_risco_credito_id_instituicao ................. [RUN]
[0m06:35:12.960667 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m06:35:12.960667 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:35:12.963342 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:35:12.964449 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:35:12.967155 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:35:12.968826 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:35:12.968826 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m06:35:12.969879 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.969879 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.969879 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m06:35:12.970938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.970938 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.972152 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m06:35:12.973343 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m06:35:12.973343 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m06:35:12.973343 [info ] [Thread-1 (]: 96 of 98 PASS not_null_fato_risco_credito_id_instituicao ....................... [[32mPASS[0m in 0.01s]
[0m06:35:12.974754 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m06:35:12.975377 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:35:12.975377 [info ] [Thread-1 (]: 97 of 98 START test not_null_fato_risco_credito_id_nivel_risco ................. [RUN]
[0m06:35:12.975377 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m06:35:12.975377 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:35:12.979401 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:35:12.980271 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:35:12.982287 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:35:12.983291 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:35:12.983794 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m06:35:12.983794 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:12.984800 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:12.984800 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m06:35:12.985306 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m06:35:12.985306 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:12.987311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m06:35:12.987931 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m06:35:12.987931 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m06:35:12.988721 [info ] [Thread-1 (]: 97 of 98 PASS not_null_fato_risco_credito_id_nivel_risco ....................... [[32mPASS[0m in 0.01s]
[0m06:35:12.989686 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m06:35:12.989686 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:35:12.989686 [info ] [Thread-1 (]: 98 of 98 START sql view model main.view_resumo_financeiro_relatorios ........... [RUN]
[0m06:35:12.991191 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393, now model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios)
[0m06:35:12.991191 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:35:12.993349 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:35:12.995016 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:35:13.007785 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:35:13.008895 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:35:13.009793 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: BEGIN
[0m06:35:13.009793 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:35:13.010351 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:13.011183 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:35:13.011183 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    
    -- Data
    t.data as data_base,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
  );

[0m06:35:13.012211 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:35:13.015110 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:35:13.015724 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */
alter view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" rename to "view_resumo_financeiro_relatorios"
[0m06:35:13.016100 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:13.016628 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m06:35:13.016628 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:35:13.016628 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m06:35:13.019281 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:35:13.021038 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m06:35:13.021038 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_backup" cascade
    
[0m06:35:13.021038 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:35:13.022802 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: Close
[0m06:35:13.022802 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae400d57-3066-4e18-b291-6baca28fbd67', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E740DC70>]}
[0m06:35:13.023334 [info ] [Thread-1 (]: 98 of 98 OK created sql view model main.view_resumo_financeiro_relatorios ...... [[32mOK[0m in 0.03s]
[0m06:35:13.023334 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m06:35:13.025026 [debug] [MainThread]: Using duckdb connection "master"
[0m06:35:13.025026 [debug] [MainThread]: On master: BEGIN
[0m06:35:13.025026 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:35:13.026033 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:35:13.026033 [debug] [MainThread]: On master: COMMIT
[0m06:35:13.026033 [debug] [MainThread]: Using duckdb connection "master"
[0m06:35:13.026033 [debug] [MainThread]: On master: COMMIT
[0m06:35:13.027029 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:35:13.027029 [debug] [MainThread]: On master: Close
[0m06:35:13.027029 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:35:13.027029 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:35:13.027029 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:35:13.027029 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' was properly closed.
[0m06:35:13.028550 [info ] [MainThread]: 
[0m06:35:13.028550 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests, 1 view model in 0 hours 0 minutes and 25.56 seconds (25.56s).
[0m06:35:13.036378 [debug] [MainThread]: Command end result
[0m06:35:13.069211 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:35:13.070961 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:35:13.077618 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:35:13.079127 [info ] [MainThread]: 
[0m06:35:13.079127 [info ] [MainThread]: [32mCompleted successfully[0m
[0m06:35:13.079997 [info ] [MainThread]: 
[0m06:35:13.079997 [info ] [MainThread]: Done. PASS=98 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=98
[0m06:35:13.081150 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 22 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:35:13.081758 [debug] [MainThread]: Command `dbt build` succeeded at 06:35:13.081758 after 28.01 seconds
[0m06:35:13.081758 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E97EEEA0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E8E47590>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000221E8E47020>]}
[0m06:35:13.081758 [debug] [MainThread]: Flushing usage events
[0m06:35:13.839235 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m06:47:51.309905 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001AD9BF17D40>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001AD9EEFBE90>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001AD9EEFAD80>]}


============================== 06:47:51.318862 | 3c4bcff1-d5df-451f-8ea2-ba89146efeda ==============================
[0m06:47:51.318862 [info ] [MainThread]: Running with dbt=1.11.5
[0m06:47:51.319888 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'fail_fast': 'False', 'debug': 'False', 'log_format': 'default', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'use_colors': 'True', 'indirect_selection': 'eager', 'invocation_command': 'dbt build --select +view_ativo_relatorios', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m06:47:51.502400 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA10A1610>]}
[0m06:47:51.551217 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001AD9FB28BF0>]}
[0m06:47:51.553832 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m06:47:51.758986 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m06:47:51.860028 [info ] [MainThread]: Unable to do partial parsing because profile has changed
[0m06:47:51.861134 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001AD9F63AB10>]}
[0m06:47:52.960421 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on 'dim_instituicao'
in package 'bacen_ifdata_analytics' (models\gold\schema.yml). Arguments to
generic tests should be nested under the `arguments` property.
[0m06:47:52.961229 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA17809B0>]}
[0m06:47:53.282034 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m06:47:53.290847 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA17C1190>]}
[0m06:47:53.362040 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:47:53.364600 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:47:53.406899 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA17D9880>]}
[0m06:47:53.406899 [info ] [MainThread]: Found 28 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m06:47:53.412047 [info ] [MainThread]: 
[0m06:47:53.412551 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m06:47:53.412551 [info ] [MainThread]: 
[0m06:47:53.413054 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m06:47:53.416693 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m06:47:53.476925 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m06:47:53.476925 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m06:47:53.477928 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:47:53.579503 [debug] [ThreadPool]: SQL status: OK in 0.102 seconds
[0m06:47:53.580068 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m06:47:53.581096 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m06:47:53.581096 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m06:47:53.585388 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:47:53.586408 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m06:47:53.586408 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m06:47:53.586408 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m06:47:53.587911 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:47:53.587911 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m06:47:53.588524 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:47:53.588524 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:47:53.588524 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m06:47:53.588524 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:47:53.589536 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:47:53.589536 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m06:47:53.589536 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m06:47:53.589536 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:47:53.589536 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m06:47:53.593158 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m06:47:53.596766 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:47:53.597092 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m06:47:53.597092 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m06:47:53.597610 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m06:47:53.597610 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m06:47:53.598156 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m06:47:53.607668 [debug] [ThreadPool]: SQL status: OK in 0.009 seconds
[0m06:47:53.608668 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m06:47:53.610160 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m06:47:53.610160 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m06:47:53.614678 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA181A270>]}
[0m06:47:53.614678 [debug] [MainThread]: Using duckdb connection "master"
[0m06:47:53.614678 [debug] [MainThread]: On master: BEGIN
[0m06:47:53.615790 [debug] [MainThread]: Opening a new connection, currently in state init
[0m06:47:53.615790 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:47:53.616373 [debug] [MainThread]: On master: COMMIT
[0m06:47:53.616373 [debug] [MainThread]: Using duckdb connection "master"
[0m06:47:53.616373 [debug] [MainThread]: On master: COMMIT
[0m06:47:53.616905 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:47:53.616905 [debug] [MainThread]: On master: Close
[0m06:47:53.620558 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:47:53.620558 [info ] [Thread-1 (]: 1 of 51 START sql table model main.dim_instituicao ............................. [RUN]
[0m06:47:53.620558 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m06:47:53.622101 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m06:47:53.635694 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:53.637696 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m06:47:53.658865 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:53.659852 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:53.660646 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m06:47:53.660646 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m06:47:53.661669 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:53.661669 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:53.661669 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m06:47:54.137994 [debug] [Thread-1 (]: SQL status: OK in 0.475 seconds
[0m06:47:54.141108 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:54.142253 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:47:54.142253 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.143347 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:54.143347 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m06:47:54.144882 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.149295 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:54.149295 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m06:47:54.149925 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.151566 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:54.151566 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m06:47:54.152594 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.162020 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:47:54.163019 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:54.163019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m06:47:54.185555 [debug] [Thread-1 (]: SQL status: OK in 0.022 seconds
[0m06:47:54.190771 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m06:47:54.190771 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m06:47:54.192369 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:54.193884 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m06:47:54.196521 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA19CA180>]}
[0m06:47:54.197147 [info ] [Thread-1 (]: 1 of 51 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.57s]
[0m06:47:54.197147 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m06:47:54.198755 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:47:54.200059 [info ] [Thread-1 (]: 2 of 51 START sql table model main.dim_localizacao ............................. [RUN]
[0m06:47:54.200576 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m06:47:54.200576 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m06:47:54.203785 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.203785 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m06:47:54.206378 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.207378 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.207378 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m06:47:54.208382 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:54.208382 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.208382 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.208382 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m06:47:54.243535 [debug] [Thread-1 (]: SQL status: OK in 0.035 seconds
[0m06:47:54.246916 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.247482 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:47:54.248988 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:54.249526 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.249526 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m06:47:54.249526 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.252746 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.252746 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m06:47:54.253743 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.255343 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.256357 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m06:47:54.256357 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.257363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:47:54.257363 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.257363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m06:47:54.259866 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:47:54.261191 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m06:47:54.262213 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m06:47:54.263196 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:54.264255 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m06:47:54.264255 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA1DD1010>]}
[0m06:47:54.264255 [info ] [Thread-1 (]: 2 of 51 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.06s]
[0m06:47:54.265399 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m06:47:54.265399 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m06:47:54.265399 [info ] [Thread-1 (]: 3 of 51 START sql table model main.dim_tempo ................................... [RUN]
[0m06:47:54.266569 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m06:47:54.266569 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m06:47:54.273606 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.274690 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m06:47:54.276862 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.277868 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.277868 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m06:47:54.277868 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:54.277868 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.277868 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.279373 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m06:47:54.333687 [debug] [Thread-1 (]: SQL status: OK in 0.054 seconds
[0m06:47:54.334335 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.334984 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:47:54.335641 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.336674 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.336674 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m06:47:54.337651 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.339474 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.339474 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m06:47:54.340982 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.342543 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.342543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m06:47:54.343569 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.344601 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:47:54.345135 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.345135 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m06:47:54.347420 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:47:54.349577 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m06:47:54.349577 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m06:47:54.351117 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:54.351679 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m06:47:54.352713 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA1DE7FB0>]}
[0m06:47:54.352713 [info ] [Thread-1 (]: 3 of 51 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.09s]
[0m06:47:54.353690 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m06:47:54.353690 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:47:54.353690 [info ] [Thread-1 (]: 4 of 51 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m06:47:54.353690 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m06:47:54.355210 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:47:54.361922 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.361922 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:47:54.364475 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.366065 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.366065 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m06:47:54.366065 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:54.367093 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:54.367093 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.368198 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido,
        l.captacoes
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos
        depositos,
        captacoes_mercado_aberto,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total,
        captacoes
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    -- Passivos
    depositos,
    captacoes_mercado_aberto,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total,
    captacoes
FROM unificacao
    );
  
  
[0m06:47:54.952871 [debug] [Thread-1 (]: SQL status: OK in 0.584 seconds
[0m06:47:54.953888 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.953888 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m06:47:54.955429 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:54.956453 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.956453 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m06:47:54.957434 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.959942 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.959942 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial" rename to "fato_balanco_patrimonial__dbt_backup"
[0m06:47:54.960949 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:54.963207 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.964321 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m06:47:54.964832 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:54.965946 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:47:54.966582 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:54.966582 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m06:47:55.101547 [debug] [Thread-1 (]: SQL status: OK in 0.135 seconds
[0m06:47:55.102553 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m06:47:55.104059 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m06:47:55.105709 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.106796 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m06:47:55.106796 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADC187A210>]}
[0m06:47:55.107812 [info ] [Thread-1 (]: 4 of 51 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.75s]
[0m06:47:55.107812 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m06:47:55.108797 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:47:55.108797 [info ] [Thread-1 (]: 5 of 51 START seed file main.seed_dim_classe_instituicao ....................... [RUN]
[0m06:47:55.108797 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m06:47:55.109796 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:47:55.109796 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:47:55.126403 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:47:55.127386 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m06:47:55.127386 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.127386 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.128387 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:47:55.128387 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */
truncate table "gold_warehouse"."main"."seed_dim_classe_instituicao"
[0m06:47:55.129387 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.135926 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:47:55.137452 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:47:55.139575 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:47:55.143193 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:47:55.146425 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:47:55.146425 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m06:47:55.146960 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m06:47:55.147964 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.147964 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m06:47:55.148981 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA1E0EFF0>]}
[0m06:47:55.149504 [info ] [Thread-1 (]: 5 of 51 OK loaded seed file main.seed_dim_classe_instituicao ................... [[32mINSERT 32[0m in 0.04s]
[0m06:47:55.149504 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m06:47:55.149504 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:47:55.149504 [info ] [Thread-1 (]: 6 of 51 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m06:47:55.149504 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m06:47:55.151166 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:47:55.151782 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:47:55.156485 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:47:55.156485 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m06:47:55.156485 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.157483 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.157483 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:47:55.157483 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m06:47:55.158481 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.158481 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:47:55.158481 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:47:55.160004 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.161016 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:47:55.162175 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:47:55.163177 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m06:47:55.163682 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m06:47:55.164733 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.164733 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m06:47:55.165775 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA1DF9160>]}
[0m06:47:55.165775 [info ] [Thread-1 (]: 6 of 51 OK loaded seed file main.seed_dim_consolidado .......................... [[32mINSERT 8[0m in 0.02s]
[0m06:47:55.166511 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m06:47:55.167139 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:47:55.167690 [info ] [Thread-1 (]: 7 of 51 START seed file main.seed_dim_controle ................................. [RUN]
[0m06:47:55.167690 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m06:47:55.167690 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:47:55.168694 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:47:55.172396 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:47:55.172396 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m06:47:55.172396 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.173424 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.173424 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:47:55.173424 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m06:47:55.174559 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.175105 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:47:55.175105 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:47:55.177116 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.177116 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:47:55.179134 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:47:55.179134 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m06:47:55.179736 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m06:47:55.179736 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.181371 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m06:47:55.181940 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA1E0CE90>]}
[0m06:47:55.182627 [info ] [Thread-1 (]: 7 of 51 OK loaded seed file main.seed_dim_controle ............................. [[32mINSERT 3[0m in 0.01s]
[0m06:47:55.183137 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m06:47:55.183137 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:47:55.183751 [info ] [Thread-1 (]: 8 of 51 START seed file main.seed_dim_segmento ................................. [RUN]
[0m06:47:55.184314 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m06:47:55.184314 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:47:55.184858 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:47:55.188723 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:47:55.188723 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m06:47:55.188723 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.189751 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.189751 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:47:55.189751 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m06:47:55.190734 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.191237 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:47:55.191237 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m06:47:55.193452 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.193452 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:47:55.195010 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:47:55.195010 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m06:47:55.195010 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m06:47:55.196584 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.196584 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m06:47:55.197589 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA1A25970>]}
[0m06:47:55.198098 [info ] [Thread-1 (]: 8 of 51 OK loaded seed file main.seed_dim_segmento ............................. [[32mINSERT 5[0m in 0.01s]
[0m06:47:55.198610 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m06:47:55.198610 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:47:55.199170 [info ] [Thread-1 (]: 9 of 51 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m06:47:55.199709 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m06:47:55.199709 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:47:55.205426 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:47:55.206433 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:47:55.218134 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:47:55.219172 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:47:55.219172 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m06:47:55.219172 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.219172 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.219172 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m06:47:55.219172 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.220763 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.223432 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m06:47:55.223432 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m06:47:55.224461 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m06:47:55.225044 [info ] [Thread-1 (]: 9 of 51 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.02s]
[0m06:47:55.225044 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m06:47:55.225044 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:47:55.226050 [info ] [Thread-1 (]: 10 of 51 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m06:47:55.226050 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m06:47:55.226050 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:47:55.229593 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:47:55.230700 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:47:55.231766 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:47:55.233288 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:47:55.233928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m06:47:55.233928 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.234482 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.234482 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m06:47:55.234482 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.235998 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.235998 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m06:47:55.238125 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m06:47:55.238125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m06:47:55.238774 [info ] [Thread-1 (]: 10 of 51 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:47:55.238774 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m06:47:55.239778 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:47:55.239778 [info ] [Thread-1 (]: 11 of 51 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:47:55.239778 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m06:47:55.240782 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:47:55.246697 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:47:55.247712 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:47:55.249695 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:47:55.250695 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:47:55.250695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m06:47:55.250695 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.250695 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.251695 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m06:47:55.251695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.257695 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:47:55.258699 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m06:47:55.259698 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m06:47:55.259698 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m06:47:55.259698 [info ] [Thread-1 (]: 11 of 51 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:47:55.260696 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m06:47:55.261384 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:47:55.261384 [info ] [Thread-1 (]: 12 of 51 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:47:55.261384 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m06:47:55.262390 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:47:55.265405 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:47:55.266678 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:47:55.269192 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:47:55.269192 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:47:55.269192 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m06:47:55.269192 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.270758 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.270758 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m06:47:55.270758 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.274591 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:47:55.276437 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m06:47:55.276437 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m06:47:55.277568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m06:47:55.277568 [info ] [Thread-1 (]: 12 of 51 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:47:55.278555 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m06:47:55.278555 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:47:55.278555 [info ] [Thread-1 (]: 13 of 51 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:47:55.279444 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m06:47:55.279444 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:47:55.283302 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:47:55.283907 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:47:55.285467 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:47:55.286478 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:47:55.286478 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m06:47:55.286478 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.287503 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.287503 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m06:47:55.288025 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.291167 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:47:55.292383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m06:47:55.293411 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m06:47:55.293411 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m06:47:55.293411 [info ] [Thread-1 (]: 13 of 51 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:47:55.293411 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m06:47:55.293411 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:47:55.295004 [info ] [Thread-1 (]: 14 of 51 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:47:55.295004 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m06:47:55.295004 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:47:55.299384 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:47:55.299384 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:47:55.301685 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:47:55.301685 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:47:55.302699 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m06:47:55.302699 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.302699 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.303695 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m06:47:55.303695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.311853 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m06:47:55.311853 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m06:47:55.313373 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m06:47:55.313373 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m06:47:55.314502 [info ] [Thread-1 (]: 14 of 51 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:47:55.314502 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m06:47:55.314502 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:47:55.315630 [info ] [Thread-1 (]: 15 of 51 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:47:55.315630 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m06:47:55.315630 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:47:55.319361 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:47:55.320697 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:47:55.323418 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:47:55.323418 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:47:55.323418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m06:47:55.323418 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.325256 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.325256 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m06:47:55.325256 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.327261 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:47:55.329278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m06:47:55.329800 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m06:47:55.329800 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m06:47:55.329800 [info ] [Thread-1 (]: 15 of 51 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:47:55.329800 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m06:47:55.329800 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:47:55.331493 [info ] [Thread-1 (]: 16 of 51 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:47:55.331493 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m06:47:55.332141 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:47:55.335391 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:47:55.336418 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:47:55.338481 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:47:55.338997 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:47:55.340000 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m06:47:55.340000 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.340000 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.341001 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m06:47:55.341001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.344588 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:47:55.346149 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m06:47:55.346708 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m06:47:55.346708 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m06:47:55.347309 [info ] [Thread-1 (]: 16 of 51 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:47:55.347309 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m06:47:55.347309 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:47:55.347309 [info ] [Thread-1 (]: 17 of 51 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:47:55.348847 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m06:47:55.348847 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:47:55.352837 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:47:55.353959 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:47:55.355583 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:47:55.356601 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:47:55.356601 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m06:47:55.356601 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.357598 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.357598 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m06:47:55.358614 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.363169 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m06:47:55.365866 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m06:47:55.366372 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m06:47:55.367057 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m06:47:55.367057 [info ] [Thread-1 (]: 17 of 51 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m06:47:55.367057 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m06:47:55.368063 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:47:55.368644 [info ] [Thread-1 (]: 18 of 51 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m06:47:55.368644 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m06:47:55.369202 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:47:55.373360 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:47:55.373360 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:47:55.375396 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:47:55.376426 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:47:55.376426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m06:47:55.377407 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.377407 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.377407 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m06:47:55.378407 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:47:55.380237 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:47:55.382248 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m06:47:55.382754 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m06:47:55.383263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m06:47:55.383875 [info ] [Thread-1 (]: 18 of 51 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.01s]
[0m06:47:55.384442 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m06:47:55.384442 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:47:55.384956 [info ] [Thread-1 (]: 19 of 51 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m06:47:55.385527 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m06:47:55.385527 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:47:55.388697 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:47:55.388697 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:47:55.391210 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:47:55.392216 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:47:55.392216 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m06:47:55.392216 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.392216 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.393412 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m06:47:55.393412 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.393412 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.394955 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m06:47:55.394955 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m06:47:55.394955 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m06:47:55.396688 [info ] [Thread-1 (]: 19 of 51 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m06:47:55.397023 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m06:47:55.397528 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:47:55.397528 [info ] [Thread-1 (]: 20 of 51 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m06:47:55.397528 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m06:47:55.397528 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:47:55.402726 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:47:55.403844 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:47:55.405483 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:47:55.406506 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:47:55.407491 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m06:47:55.407491 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.407491 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.407491 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m06:47:55.408673 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.409688 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.410595 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m06:47:55.411625 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m06:47:55.411625 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m06:47:55.411625 [info ] [Thread-1 (]: 20 of 51 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.01s]
[0m06:47:55.413130 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m06:47:55.413130 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:47:55.413130 [info ] [Thread-1 (]: 21 of 51 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m06:47:55.413130 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m06:47:55.413130 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:47:55.417200 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:47:55.417200 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:47:55.419564 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:47:55.419564 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:47:55.419564 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m06:47:55.419564 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.421237 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.421237 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m06:47:55.421237 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:47:55.421783 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.423816 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m06:47:55.424443 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m06:47:55.424948 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m06:47:55.425453 [info ] [Thread-1 (]: 21 of 51 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.01s]
[0m06:47:55.425453 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m06:47:55.425453 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:47:55.426458 [info ] [Thread-1 (]: 22 of 51 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m06:47:55.426458 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m06:47:55.426458 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:47:55.429464 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:47:55.433201 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:47:55.435589 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:47:55.436124 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:47:55.436124 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m06:47:55.436124 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.436124 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.436124 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m06:47:55.437649 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.438326 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.439357 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m06:47:55.439357 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m06:47:55.439357 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m06:47:55.439357 [info ] [Thread-1 (]: 22 of 51 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m06:47:55.440862 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m06:47:55.440862 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:47:55.441865 [info ] [Thread-1 (]: 23 of 51 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:47:55.441865 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m06:47:55.441865 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:47:55.445301 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:47:55.446651 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:47:55.447711 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:47:55.448744 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:47:55.448744 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m06:47:55.449412 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.449412 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.449412 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m06:47:55.449412 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.452734 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:47:55.453734 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m06:47:55.453734 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m06:47:55.453734 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m06:47:55.453734 [info ] [Thread-1 (]: 23 of 51 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:47:55.455273 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m06:47:55.455273 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:47:55.456038 [info ] [Thread-1 (]: 24 of 51 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:47:55.456038 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m06:47:55.456038 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:47:55.459553 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:47:55.460560 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:47:55.463630 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:47:55.464642 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:47:55.464642 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m06:47:55.465150 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.465675 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.465675 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m06:47:55.466377 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.468206 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:47:55.469218 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m06:47:55.469218 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m06:47:55.469218 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m06:47:55.470895 [info ] [Thread-1 (]: 24 of 51 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:47:55.470895 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m06:47:55.471907 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:47:55.471907 [info ] [Thread-1 (]: 25 of 51 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:47:55.471907 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m06:47:55.471907 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:47:55.475842 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:47:55.476775 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:47:55.477782 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:47:55.479938 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:47:55.479938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m06:47:55.479938 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.480946 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.481452 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m06:47:55.481452 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.483617 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:47:55.484759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m06:47:55.485448 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m06:47:55.485448 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m06:47:55.485448 [info ] [Thread-1 (]: 25 of 51 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:47:55.486454 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m06:47:55.486454 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:47:55.486454 [info ] [Thread-1 (]: 26 of 51 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:47:55.486454 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m06:47:55.487960 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:47:55.491292 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:47:55.492027 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:47:55.493538 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:47:55.494543 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:47:55.494543 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m06:47:55.494543 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.495549 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.496191 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m06:47:55.496191 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.499522 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:47:55.500622 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m06:47:55.501225 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m06:47:55.501225 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m06:47:55.501965 [info ] [Thread-1 (]: 26 of 51 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:47:55.501965 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m06:47:55.501965 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:47:55.503072 [info ] [Thread-1 (]: 27 of 51 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:47:55.503072 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m06:47:55.503072 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:47:55.506817 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:47:55.507837 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:47:55.509703 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:47:55.510553 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:47:55.511028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m06:47:55.511028 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.511668 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.511668 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m06:47:55.511668 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.512665 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.513603 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m06:47:55.514845 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m06:47:55.514845 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m06:47:55.515751 [info ] [Thread-1 (]: 27 of 51 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:47:55.515751 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m06:47:55.516457 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:47:55.516457 [info ] [Thread-1 (]: 28 of 51 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:47:55.517064 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m06:47:55.517064 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:47:55.520849 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:47:55.520849 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:47:55.523424 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:47:55.523424 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:47:55.524525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m06:47:55.524525 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.525149 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.525149 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m06:47:55.525149 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.527155 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m06:47:55.528263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m06:47:55.529198 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m06:47:55.529198 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m06:47:55.529808 [info ] [Thread-1 (]: 28 of 51 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:47:55.529808 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m06:47:55.529808 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:47:55.529808 [info ] [Thread-1 (]: 29 of 51 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:47:55.529808 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m06:47:55.531646 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:47:55.534862 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:47:55.535647 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:47:55.538706 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:47:55.538706 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:47:55.539713 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m06:47:55.539713 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.540217 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.540722 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m06:47:55.540722 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.543313 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:47:55.545033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m06:47:55.545033 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m06:47:55.546040 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m06:47:55.546546 [info ] [Thread-1 (]: 29 of 51 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m06:47:55.546546 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m06:47:55.547109 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:47:55.547109 [info ] [Thread-1 (]: 30 of 51 START test unique_dim_tempo_id_data ................................... [RUN]
[0m06:47:55.547109 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m06:47:55.547109 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:47:55.550508 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:47:55.551184 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:47:55.552932 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:47:55.553980 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:47:55.553980 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m06:47:55.553980 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.553980 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.553980 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m06:47:55.553980 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:47:55.557102 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.558223 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m06:47:55.558223 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m06:47:55.558223 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m06:47:55.558223 [info ] [Thread-1 (]: 30 of 51 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m06:47:55.559782 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m06:47:55.559782 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:47:55.560430 [info ] [Thread-1 (]: 31 of 51 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m06:47:55.561082 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m06:47:55.561621 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:47:55.563170 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:47:55.565498 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:47:55.567218 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:47:55.567218 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:47:55.567218 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m06:47:55.567218 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.568872 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.568872 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m06:47:55.568872 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.569878 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.571384 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m06:47:55.571888 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m06:47:55.571888 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m06:47:55.571888 [info ] [Thread-1 (]: 31 of 51 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.01s]
[0m06:47:55.571888 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m06:47:55.573430 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:47:55.573430 [info ] [Thread-1 (]: 32 of 51 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m06:47:55.573430 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m06:47:55.573430 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:47:55.577163 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:47:55.577163 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:47:55.579740 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:47:55.580113 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:47:55.580113 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m06:47:55.581117 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.581117 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.581117 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m06:47:55.582255 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.582255 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.583569 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m06:47:55.584338 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m06:47:55.585105 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m06:47:55.585105 [info ] [Thread-1 (]: 32 of 51 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m06:47:55.586109 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m06:47:55.586109 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:47:55.586109 [info ] [Thread-1 (]: 33 of 51 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m06:47:55.586109 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m06:47:55.586109 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:47:55.589324 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:47:55.591225 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:47:55.592741 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:47:55.593656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:47:55.593656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m06:47:55.593656 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.594681 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.594681 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m06:47:55.595189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.597949 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m06:47:55.599014 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m06:47:55.599577 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m06:47:55.599577 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m06:47:55.599577 [info ] [Thread-1 (]: 33 of 51 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m06:47:55.601012 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m06:47:55.601558 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:47:55.601558 [info ] [Thread-1 (]: 34 of 51 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m06:47:55.602563 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m06:47:55.602563 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:47:55.610144 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:47:55.613172 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:47:55.616624 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:47:55.617630 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:47:55.617630 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m06:47:55.617630 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.619135 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.619135 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m06:47:55.619135 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.625193 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m06:47:55.625698 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m06:47:55.626704 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m06:47:55.627704 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m06:47:55.627704 [info ] [Thread-1 (]: 34 of 51 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m06:47:55.627704 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m06:47:55.629209 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:47:55.629209 [info ] [Thread-1 (]: 35 of 51 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m06:47:55.629209 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m06:47:55.630214 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:47:55.632229 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.633345 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:47:55.635468 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.636474 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.636474 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m06:47:55.636474 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.637522 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.637522 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.638132 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m06:47:55.638885 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.638885 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.638885 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m06:47:55.639990 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.641488 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.641488 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m06:47:55.642106 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.643917 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.643917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao" rename to "dim_classe_instituicao__dbt_backup"
[0m06:47:55.644957 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.646653 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.647393 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m06:47:55.647393 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.648917 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:47:55.648917 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.649570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m06:47:55.653705 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m06:47:55.655228 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m06:47:55.655228 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m06:47:55.655880 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.657425 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m06:47:55.657425 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA1DF4500>]}
[0m06:47:55.657425 [info ] [Thread-1 (]: 35 of 51 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.03s]
[0m06:47:55.658435 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m06:47:55.658435 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:47:55.658435 [info ] [Thread-1 (]: 36 of 51 START sql table model main.dim_consolidado ............................ [RUN]
[0m06:47:55.659943 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m06:47:55.659943 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m06:47:55.661453 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.663460 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m06:47:55.667066 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.668072 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.668072 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m06:47:55.668072 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.669071 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.669071 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.670665 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m06:47:55.672839 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.673355 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.673355 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m06:47:55.673355 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.676779 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.676779 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m06:47:55.677784 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.680023 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.681057 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m06:47:55.681057 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.683263 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.683263 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m06:47:55.684314 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.685069 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:47:55.685069 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.685069 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m06:47:55.686097 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.688163 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m06:47:55.688909 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m06:47:55.689920 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.689920 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m06:47:55.690936 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADC1862990>]}
[0m06:47:55.690936 [info ] [Thread-1 (]: 36 of 51 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m06:47:55.690936 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m06:47:55.692012 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m06:47:55.692012 [info ] [Thread-1 (]: 37 of 51 START sql table model main.dim_controle ............................... [RUN]
[0m06:47:55.693037 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m06:47:55.693037 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m06:47:55.694623 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.696382 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m06:47:55.698591 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.699321 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.699321 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m06:47:55.699957 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.700540 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.700540 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.701068 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m06:47:55.701722 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.702729 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.702729 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m06:47:55.702729 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.704234 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.704234 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m06:47:55.705238 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.707876 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.708874 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m06:47:55.709377 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.711684 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.711684 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m06:47:55.711684 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.713192 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:47:55.714200 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.714200 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m06:47:55.715212 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.717274 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m06:47:55.717274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m06:47:55.718281 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.719787 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m06:47:55.719787 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA17927B0>]}
[0m06:47:55.720795 [info ] [Thread-1 (]: 37 of 51 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m06:47:55.720795 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m06:47:55.720795 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m06:47:55.720795 [info ] [Thread-1 (]: 38 of 51 START sql table model main.dim_segmento ............................... [RUN]
[0m06:47:55.722575 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_segmento)
[0m06:47:55.723115 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m06:47:55.724647 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.725692 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m06:47:55.730016 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.731045 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.731045 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m06:47:55.731045 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.732250 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.732250 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.732782 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m06:47:55.733810 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.733810 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.733810 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m06:47:55.735342 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.736371 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.736371 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m06:47:55.736371 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.739659 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.739659 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m06:47:55.741164 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.743220 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.743220 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m06:47:55.743220 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.744778 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:47:55.744778 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.745790 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m06:47:55.746293 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.747442 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m06:47:55.747442 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m06:47:55.749211 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.749852 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m06:47:55.750859 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA1E0CDD0>]}
[0m06:47:55.751364 [info ] [Thread-1 (]: 38 of 51 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m06:47:55.751364 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m06:47:55.752371 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:47:55.752371 [info ] [Thread-1 (]: 39 of 51 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m06:47:55.752371 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m06:47:55.752371 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:47:55.756524 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:47:55.756524 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:47:55.758524 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:47:55.758524 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:47:55.760028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m06:47:55.760028 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.760738 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.760738 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m06:47:55.760738 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.761775 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.763303 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m06:47:55.763303 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m06:47:55.764334 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m06:47:55.764334 [info ] [Thread-1 (]: 39 of 51 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m06:47:55.764334 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m06:47:55.764334 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:47:55.764334 [info ] [Thread-1 (]: 40 of 51 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m06:47:55.766146 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m06:47:55.766146 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:47:55.769295 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:47:55.770906 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:47:55.771950 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:47:55.773489 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:47:55.773489 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m06:47:55.773489 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.774531 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.774531 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m06:47:55.775311 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.776323 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.777723 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m06:47:55.777723 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m06:47:55.777723 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m06:47:55.777723 [info ] [Thread-1 (]: 40 of 51 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.01s]
[0m06:47:55.779246 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m06:47:55.779246 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:47:55.779974 [info ] [Thread-1 (]: 41 of 51 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m06:47:55.779974 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m06:47:55.779974 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:47:55.783323 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:47:55.783889 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:47:55.786412 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:47:55.787413 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:47:55.788084 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m06:47:55.788084 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.788687 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.788687 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m06:47:55.788687 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:47:55.789717 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.791244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m06:47:55.792277 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m06:47:55.792277 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m06:47:55.793372 [info ] [Thread-1 (]: 41 of 51 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.01s]
[0m06:47:55.793372 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m06:47:55.793372 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:47:55.793372 [info ] [Thread-1 (]: 42 of 51 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m06:47:55.793372 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m06:47:55.794956 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:47:55.796982 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:47:55.798679 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:47:55.799949 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:47:55.800954 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:47:55.800954 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m06:47:55.801459 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.801459 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.801459 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m06:47:55.802466 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.802466 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.803996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m06:47:55.803996 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m06:47:55.803996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m06:47:55.805606 [info ] [Thread-1 (]: 42 of 51 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m06:47:55.805606 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m06:47:55.805606 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:47:55.805606 [info ] [Thread-1 (]: 43 of 51 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m06:47:55.805606 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m06:47:55.807132 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:47:55.810401 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:47:55.811003 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:47:55.812015 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:47:55.813031 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:47:55.813031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m06:47:55.813031 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.814729 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.814729 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m06:47:55.814729 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.816359 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.816872 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m06:47:55.817893 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m06:47:55.818879 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m06:47:55.818879 [info ] [Thread-1 (]: 43 of 51 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m06:47:55.819385 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m06:47:55.819385 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:47:55.819385 [info ] [Thread-1 (]: 44 of 51 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m06:47:55.819385 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m06:47:55.820890 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:47:55.823255 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:47:55.824266 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:47:55.825229 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:47:55.826234 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:47:55.826234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m06:47:55.826234 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.827235 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.827235 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m06:47:55.827235 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:47:55.828740 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.829835 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m06:47:55.829835 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m06:47:55.829835 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m06:47:55.831523 [info ] [Thread-1 (]: 44 of 51 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.01s]
[0m06:47:55.831523 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m06:47:55.832203 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:47:55.832203 [info ] [Thread-1 (]: 45 of 51 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m06:47:55.832203 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m06:47:55.833209 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:47:55.835498 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:47:55.836505 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:47:55.838011 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:47:55.838672 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:47:55.838672 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m06:47:55.838672 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.839678 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.839678 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m06:47:55.839678 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.839678 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.841184 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m06:47:55.842695 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m06:47:55.842695 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m06:47:55.843200 [info ] [Thread-1 (]: 45 of 51 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m06:47:55.843715 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m06:47:55.843715 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:47:55.843715 [info ] [Thread-1 (]: 46 of 51 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m06:47:55.844764 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m06:47:55.844764 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:47:55.849761 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:47:55.850767 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:47:55.851777 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:47:55.852783 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:47:55.852783 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m06:47:55.853784 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.854291 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.854291 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m06:47:55.854291 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.855989 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.857022 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m06:47:55.858010 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m06:47:55.858010 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m06:47:55.858010 [info ] [Thread-1 (]: 46 of 51 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m06:47:55.859496 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m06:47:55.859496 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:47:55.859496 [info ] [Thread-1 (]: 47 of 51 START test unique_dim_controle_id_controle ............................ [RUN]
[0m06:47:55.860500 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m06:47:55.860500 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:47:55.863127 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:47:55.863127 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:47:55.865830 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:47:55.866909 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:47:55.866909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m06:47:55.866909 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.866909 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.867915 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m06:47:55.867915 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:47:55.868917 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.870075 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m06:47:55.870596 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m06:47:55.870596 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m06:47:55.870596 [info ] [Thread-1 (]: 47 of 51 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m06:47:55.872139 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m06:47:55.872139 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:47:55.872139 [info ] [Thread-1 (]: 48 of 51 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m06:47:55.873142 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m06:47:55.873142 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:47:55.875311 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:47:55.876339 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:47:55.878322 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:47:55.879338 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:47:55.879338 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m06:47:55.879849 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.879849 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.879849 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m06:47:55.879849 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.881869 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.882996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m06:47:55.884168 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m06:47:55.884708 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m06:47:55.884708 [info ] [Thread-1 (]: 48 of 51 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m06:47:55.886368 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m06:47:55.886368 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:47:55.886368 [info ] [Thread-1 (]: 49 of 51 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m06:47:55.886368 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m06:47:55.887870 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:47:55.891037 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:47:55.892066 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:47:55.893158 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:47:55.894791 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:47:55.894791 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m06:47:55.894791 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.894791 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.894791 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m06:47:55.896472 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m06:47:55.897530 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.898677 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m06:47:55.899698 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m06:47:55.899698 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m06:47:55.899698 [info ] [Thread-1 (]: 49 of 51 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.01s]
[0m06:47:55.900852 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m06:47:55.900852 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:47:55.901540 [info ] [Thread-1 (]: 50 of 51 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m06:47:55.901540 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m06:47:55.901540 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:47:55.903911 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:47:55.905584 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:47:55.908610 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:47:55.909599 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:47:55.909599 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m06:47:55.910108 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.910108 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.910740 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m06:47:55.910740 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m06:47:55.911760 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.913692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m06:47:55.914305 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m06:47:55.914808 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m06:47:55.914808 [info ] [Thread-1 (]: 50 of 51 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.01s]
[0m06:47:55.915398 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m06:47:55.916413 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_ativo_relatorios
[0m06:47:55.916917 [info ] [Thread-1 (]: 51 of 51 START sql view model main.view_ativo_relatorios ....................... [RUN]
[0m06:47:55.916917 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now model.bacen_ifdata_analytics.view_ativo_relatorios)
[0m06:47:55.916917 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_ativo_relatorios
[0m06:47:55.972136 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_ativo_relatorios"
[0m06:47:55.972456 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_ativo_relatorios
[0m06:47:55.984829 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_ativo_relatorios"
[0m06:47:55.985374 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_ativo_relatorios"
[0m06:47:55.986386 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_ativo_relatorios: BEGIN
[0m06:47:55.986386 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m06:47:55.986386 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.987384 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_ativo_relatorios"
[0m06:47:55.987384 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_ativo_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_ativo_relatorios"} */

  
  create view "gold_warehouse"."main"."view_ativo_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_balanco_patrimonial"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
),
dim_classe AS (
    SELECT * FROM "gold_warehouse"."main"."dim_classe_instituicao"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    cl.descricao as classe_instituicao,
    
    -- Data
    t.data as data_base,
    
    -- Fatos Ativo
    f.disponibilidades,
    f.aplicacoes_interfinanceiras_liquidez,
    f.tvm_derivativos,
    f.operacoes_de_credito,
    f.provisao_operacoes_de_credito,
    f.operacoes_de_credito_liquidas_provisao,
    f.arrendamento_mercantil_a_receber,
    f.imobilizado_de_arrendamento,
    f.credores_antecipacao_valor_residual,
    f.provisao_arrendamento_mercantil,
    f.arrendamento_mercantil_liquido_de_provisao,
    f.outros_creditos_liquido_de_provisao,
    f.outros_ativos_realizaveis,
    f.permanente_ajustado,
    f.ativo_total_ajustado,
    f.ativo_total

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
LEFT JOIN dim_classe cl ON i.id_classe = cl.id_classe
  );

[0m06:47:55.988714 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.989741 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_ativo_relatorios"
[0m06:47:55.991262 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_ativo_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_ativo_relatorios"} */
alter view "gold_warehouse"."main"."view_ativo_relatorios__dbt_tmp" rename to "view_ativo_relatorios"
[0m06:47:55.991262 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.992806 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_ativo_relatorios: COMMIT
[0m06:47:55.992806 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_ativo_relatorios"
[0m06:47:55.993327 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_ativo_relatorios: COMMIT
[0m06:47:55.993327 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m06:47:55.995989 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_ativo_relatorios"
[0m06:47:55.996494 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_ativo_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_ativo_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_ativo_relatorios__dbt_backup" cascade
    
[0m06:47:55.996494 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m06:47:55.996999 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_ativo_relatorios: Close
[0m06:47:55.998006 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3c4bcff1-d5df-451f-8ea2-ba89146efeda', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001ADA13B3C50>]}
[0m06:47:55.998006 [info ] [Thread-1 (]: 51 of 51 OK created sql view model main.view_ativo_relatorios .................. [[32mOK[0m in 0.08s]
[0m06:47:55.999010 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_ativo_relatorios
[0m06:47:55.999571 [debug] [MainThread]: Using duckdb connection "master"
[0m06:47:56.000579 [debug] [MainThread]: On master: BEGIN
[0m06:47:56.000579 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m06:47:56.001152 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:47:56.001152 [debug] [MainThread]: On master: COMMIT
[0m06:47:56.001678 [debug] [MainThread]: Using duckdb connection "master"
[0m06:47:56.001678 [debug] [MainThread]: On master: COMMIT
[0m06:47:56.001678 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m06:47:56.001678 [debug] [MainThread]: On master: Close
[0m06:47:56.001678 [debug] [MainThread]: Connection 'master' was properly closed.
[0m06:47:56.002709 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m06:47:56.002709 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m06:47:56.002709 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_ativo_relatorios' was properly closed.
[0m06:47:56.002709 [info ] [MainThread]: 
[0m06:47:56.003708 [info ] [MainThread]: Finished running 4 seeds, 8 table models, 38 data tests, 1 view model in 0 hours 0 minutes and 2.59 seconds (2.59s).
[0m06:47:56.007452 [debug] [MainThread]: Command end result
[0m06:47:56.035460 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m06:47:56.037474 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m06:47:56.043934 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m06:47:56.043934 [info ] [MainThread]: 
[0m06:47:56.043934 [info ] [MainThread]: [32mCompleted successfully[0m
[0m06:47:56.043934 [info ] [MainThread]: 
[0m06:47:56.044950 [info ] [MainThread]: Done. PASS=51 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=51
[0m06:47:56.044950 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 22 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m06:47:56.044950 [debug] [MainThread]: Command `dbt build` succeeded at 06:47:56.044950 after 5.04 seconds
[0m06:47:56.046377 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001AD9D3C90D0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001AD9EA55E50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000001AD9FE969F0>]}
[0m06:47:56.046377 [debug] [MainThread]: Flushing usage events
[0m06:47:56.850588 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m07:04:02.461766 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021761296090>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000217616C6A50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021761297020>]}


============================== 07:04:02.466960 | 830cab07-f9be-4a88-9bd5-b637fd898737 ==============================
[0m07:04:02.466960 [info ] [MainThread]: Running with dbt=1.11.5
[0m07:04:02.467965 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'indirect_selection': 'eager', 'invocation_command': 'dbt build --select +view_balanco_patrimonial_relatorios', 'use_colors': 'True', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m07:04:02.675600 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021761B49550>]}
[0m07:04:02.724810 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002175E798590>]}
[0m07:04:02.727556 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m07:04:02.977481 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m07:04:03.194891 [debug] [MainThread]: Partial parsing enabled: 1 files deleted, 1 files added, 2 files changed.
[0m07:04:03.194891 [debug] [MainThread]: Partial parsing: added file: bacen_ifdata_analytics://models\gold\view_balanco_patrimonial_relatorios.sql
[0m07:04:03.196516 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\schema.yml
[0m07:04:03.196516 [debug] [MainThread]: Partial parsing: deleted file: bacen_ifdata_analytics://models\gold\view_ativo_relatorios.sql
[0m07:04:03.197105 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_balanco_patrimonial.sql
[0m07:04:03.569421 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_balanco_patrimonial' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m07:04:03.569421 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021763640890>]}
[0m07:04:03.646683 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m07:04:03.659881 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000217636609E0>]}
[0m07:04:03.745079 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:04:03.749528 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:04:03.814697 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021763402450>]}
[0m07:04:03.814697 [info ] [MainThread]: Found 28 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m07:04:03.819358 [info ] [MainThread]: 
[0m07:04:03.820871 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m07:04:03.820871 [info ] [MainThread]: 
[0m07:04:03.820871 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m07:04:03.826038 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m07:04:03.977578 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m07:04:03.977578 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m07:04:03.979099 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:04:04.548656 [debug] [ThreadPool]: SQL status: OK in 0.569 seconds
[0m07:04:04.549861 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m07:04:04.549861 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m07:04:04.550865 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m07:04:04.555584 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:04:04.556205 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m07:04:04.556205 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m07:04:04.556837 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m07:04:04.557842 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:04:04.557842 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m07:04:04.559362 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:04:04.559362 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:04:04.559917 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m07:04:04.560568 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m07:04:04.560568 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:04:04.560568 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:04:04.561572 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:04:04.561572 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:04:04.561572 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m07:04:04.563074 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m07:04:04.568433 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:04:04.568981 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m07:04:04.568981 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:04:04.569523 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:04:04.569523 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:04:04.569523 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m07:04:04.593264 [debug] [ThreadPool]: SQL status: OK in 0.024 seconds
[0m07:04:04.596565 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m07:04:04.597202 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m07:04:04.599311 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m07:04:04.603712 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021763479730>]}
[0m07:04:04.603712 [debug] [MainThread]: Using duckdb connection "master"
[0m07:04:04.603712 [debug] [MainThread]: On master: BEGIN
[0m07:04:04.605288 [debug] [MainThread]: Opening a new connection, currently in state init
[0m07:04:04.605942 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m07:04:04.605942 [debug] [MainThread]: On master: COMMIT
[0m07:04:04.606971 [debug] [MainThread]: Using duckdb connection "master"
[0m07:04:04.606971 [debug] [MainThread]: On master: COMMIT
[0m07:04:04.607970 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:04:04.607970 [debug] [MainThread]: On master: Close
[0m07:04:04.613148 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:04:04.614152 [info ] [Thread-1 (]: 1 of 51 START sql table model main.dim_instituicao ............................. [RUN]
[0m07:04:04.614654 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m07:04:04.614654 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m07:04:04.627045 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:04.629044 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m07:04:04.654377 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:04.656428 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:04.657412 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m07:04:04.657412 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m07:04:04.658412 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:04.658412 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:04.660554 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m07:04:05.199639 [debug] [Thread-1 (]: SQL status: OK in 0.537 seconds
[0m07:04:05.203729 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:05.203729 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:04:05.203729 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.205418 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:05.205418 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:04:05.206441 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:05.211595 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:05.211595 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m07:04:05.213100 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:05.215712 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:05.215712 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m07:04:05.216799 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.227324 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:04:05.227324 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:05.227324 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:04:05.241157 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m07:04:05.244808 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:04:05.244808 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m07:04:05.246941 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:05.248494 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m07:04:05.251136 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021764B654C0>]}
[0m07:04:05.251136 [info ] [Thread-1 (]: 1 of 51 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.63s]
[0m07:04:05.251765 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:04:05.252783 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:04:05.252783 [info ] [Thread-1 (]: 2 of 51 START sql table model main.dim_localizacao ............................. [RUN]
[0m07:04:05.253779 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m07:04:05.254319 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m07:04:05.257378 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.257919 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m07:04:05.261566 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.263101 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.263101 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m07:04:05.263101 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:05.263101 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.264821 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.264821 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m07:04:05.325004 [debug] [Thread-1 (]: SQL status: OK in 0.059 seconds
[0m07:04:05.325609 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.326639 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:04:05.326639 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.327620 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.327620 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:04:05.329134 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.331877 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.331877 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m07:04:05.331877 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.334640 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.335231 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m07:04:05.335231 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.336262 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:04:05.336262 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.336262 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:04:05.339378 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:05.340980 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:04:05.340980 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m07:04:05.342001 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:05.344816 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m07:04:05.344816 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021763A8F050>]}
[0m07:04:05.344816 [info ] [Thread-1 (]: 2 of 51 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.09s]
[0m07:04:05.344816 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:04:05.346596 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m07:04:05.346596 [info ] [Thread-1 (]: 3 of 51 START sql table model main.dim_tempo ................................... [RUN]
[0m07:04:05.347322 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m07:04:05.347322 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m07:04:05.353619 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.356404 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m07:04:05.359902 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.360711 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.360711 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m07:04:05.361719 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:05.361719 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:05.361719 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.361719 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m07:04:05.434559 [debug] [Thread-1 (]: SQL status: OK in 0.072 seconds
[0m07:04:05.436123 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.436123 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:04:05.436123 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.437645 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.438252 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:04:05.439281 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.442978 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.443539 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m07:04:05.443539 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.446309 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.446309 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m07:04:05.446903 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:05.447906 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:04:05.447906 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.448408 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:04:05.449511 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:05.451603 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:04:05.451603 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m07:04:05.452634 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:05.454140 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m07:04:05.454140 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021763A80A40>]}
[0m07:04:05.454140 [info ] [Thread-1 (]: 3 of 51 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.11s]
[0m07:04:05.455645 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m07:04:05.455645 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:04:05.455645 [info ] [Thread-1 (]: 4 of 51 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m07:04:05.456651 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m07:04:05.456651 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:04:05.460691 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:05.461694 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:04:05.464324 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:05.465875 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:05.466509 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m07:04:05.466509 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:05.467051 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:05.467051 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:05.468072 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos (Prudential version with accents on some cols)
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    
    -- Passivos (Novas Contas Inseridas)
    depositos_vista,
    depositos_poupanca,
    depositos_interfinanceiros,
    depositos_a_prazo,
    conta_de_pagamento_pre_paga,
    depositos_outros,
    depositos,
    captacoes_mercado_aberto,
    letras_de_credito_imobiliario,
    letras_de_credito_agronegocio,
    letras_financeiras,
    obrigacoes_titulos_e_valores_mobiliarios_exterior,
    outros_recursos_de_aceites_e_emissao_de_titulos,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    captacoes,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total

FROM unificacao
    );
  
  
[0m07:04:06.361924 [debug] [Thread-1 (]: SQL status: OK in 0.894 seconds
[0m07:04:06.364441 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:06.364947 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m07:04:06.365453 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.366967 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:06.367976 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m07:04:06.369481 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.372396 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:06.372396 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial" rename to "fato_balanco_patrimonial__dbt_backup"
[0m07:04:06.373909 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.376937 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:06.377937 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m07:04:06.377937 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.380066 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:04:06.380066 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:06.381073 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:04:06.598539 [debug] [Thread-1 (]: SQL status: OK in 0.217 seconds
[0m07:04:06.601796 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:04:06.602802 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m07:04:06.603965 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:06.605840 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m07:04:06.606848 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021764BEDD60>]}
[0m07:04:06.606848 [info ] [Thread-1 (]: 4 of 51 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 1.15s]
[0m07:04:06.606848 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:04:06.607846 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:04:06.607846 [info ] [Thread-1 (]: 5 of 51 START seed file main.seed_dim_classe_instituicao ....................... [RUN]
[0m07:04:06.607846 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m07:04:06.607846 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:04:06.607846 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:04:06.634238 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:04:06.634766 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m07:04:06.634766 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.635341 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.635926 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:04:06.635926 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */
truncate table "gold_warehouse"."main"."seed_dim_classe_instituicao"
[0m07:04:06.635926 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.643186 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:04:06.643186 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:04:06.652932 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m07:04:06.656475 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:04:06.658451 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:04:06.658451 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:04:06.659451 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:04:06.660592 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:06.661597 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m07:04:06.661597 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021764BCA9C0>]}
[0m07:04:06.661597 [info ] [Thread-1 (]: 5 of 51 OK loaded seed file main.seed_dim_classe_instituicao ................... [[32mINSERT 32[0m in 0.05s]
[0m07:04:06.663135 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:04:06.663135 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:04:06.663135 [info ] [Thread-1 (]: 6 of 51 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m07:04:06.663135 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m07:04:06.664781 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:04:06.664781 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:04:06.669084 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:04:06.669084 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m07:04:06.669589 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.669589 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.669589 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:04:06.670595 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m07:04:06.671099 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.672129 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:04:06.672129 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:04:06.673734 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.674239 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:04:06.675454 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:04:06.675454 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:04:06.676461 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:04:06.677465 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.678468 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m07:04:06.678468 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021764BB21B0>]}
[0m07:04:06.678468 [info ] [Thread-1 (]: 6 of 51 OK loaded seed file main.seed_dim_consolidado .......................... [[32mINSERT 8[0m in 0.02s]
[0m07:04:06.679467 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:04:06.679972 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:04:06.680598 [info ] [Thread-1 (]: 7 of 51 START seed file main.seed_dim_controle ................................. [RUN]
[0m07:04:06.681106 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m07:04:06.681106 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:04:06.682110 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:04:06.685477 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:04:06.685477 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m07:04:06.686483 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.686483 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.686483 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:04:06.687483 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m07:04:06.687993 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.688561 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:04:06.688561 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:04:06.690757 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.691265 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:04:06.692269 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:04:06.693274 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:04:06.693274 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:04:06.694782 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.694782 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m07:04:06.697269 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021764BC1730>]}
[0m07:04:06.697772 [info ] [Thread-1 (]: 7 of 51 OK loaded seed file main.seed_dim_controle ............................. [[32mINSERT 3[0m in 0.01s]
[0m07:04:06.697772 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:04:06.698776 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:04:06.699282 [info ] [Thread-1 (]: 8 of 51 START seed file main.seed_dim_segmento ................................. [RUN]
[0m07:04:06.699862 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m07:04:06.699862 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:04:06.701373 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:04:06.709670 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:04:06.710821 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m07:04:06.710821 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.711828 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.711828 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:04:06.711828 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m07:04:06.713087 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.714699 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:04:06.714699 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:04:06.717432 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:06.717432 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:04:06.721078 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:04:06.722106 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:04:06.722106 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:04:06.724796 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:06.725422 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m07:04:06.725422 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021764C1E360>]}
[0m07:04:06.726455 [info ] [Thread-1 (]: 8 of 51 OK loaded seed file main.seed_dim_segmento ............................. [[32mINSERT 5[0m in 0.03s]
[0m07:04:06.726455 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:04:06.727455 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:04:06.728087 [info ] [Thread-1 (]: 9 of 51 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m07:04:06.729099 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m07:04:06.729602 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:04:06.741273 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:04:06.743330 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:04:06.763055 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:04:06.765619 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:04:06.766140 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m07:04:06.766140 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.767151 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.767151 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:04:06.767151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:04:06.768730 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.773151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m07:04:06.774686 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m07:04:06.775226 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m07:04:06.775746 [info ] [Thread-1 (]: 9 of 51 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.05s]
[0m07:04:06.776749 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:04:06.777749 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:04:06.777749 [info ] [Thread-1 (]: 10 of 51 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m07:04:06.779268 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m07:04:06.779268 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:04:06.784651 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:04:06.786269 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:04:06.788438 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:04:06.789976 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:04:06.791001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m07:04:06.791001 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.792122 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.793392 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:04:06.795076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:04:06.796588 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.797164 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m07:04:06.799715 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m07:04:06.799715 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m07:04:06.801105 [info ] [Thread-1 (]: 10 of 51 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m07:04:06.801679 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:04:06.801679 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:04:06.801679 [info ] [Thread-1 (]: 11 of 51 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:04:06.802683 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m07:04:06.802683 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:04:06.806427 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:04:06.807461 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:04:06.809444 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:04:06.810507 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:04:06.810507 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m07:04:06.810507 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.811535 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.811535 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:04:06.811535 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:06.818005 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:04:06.819525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m07:04:06.820536 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m07:04:06.821040 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m07:04:06.821040 [info ] [Thread-1 (]: 11 of 51 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:04:06.822044 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:04:06.822549 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:04:06.822549 [info ] [Thread-1 (]: 12 of 51 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:04:06.823054 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m07:04:06.823054 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:04:06.827248 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:04:06.828221 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:04:06.829726 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:04:06.829726 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:04:06.831333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m07:04:06.831333 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.831965 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.831965 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:04:06.831965 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:06.836641 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:04:06.838292 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m07:04:06.838292 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m07:04:06.839300 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m07:04:06.839806 [info ] [Thread-1 (]: 12 of 51 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:04:06.839806 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:04:06.839806 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:04:06.840810 [info ] [Thread-1 (]: 13 of 51 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:04:06.840810 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m07:04:06.840810 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:04:06.844912 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:04:06.847129 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:04:06.899687 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:04:06.902505 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:04:06.902505 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m07:04:06.902505 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.902505 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.902505 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:04:06.904030 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:06.910942 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:04:06.914454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m07:04:06.915529 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m07:04:06.915529 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m07:04:06.917185 [info ] [Thread-1 (]: 13 of 51 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.08s]
[0m07:04:06.918761 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:04:06.919289 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:04:06.919289 [info ] [Thread-1 (]: 14 of 51 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:04:06.920836 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m07:04:06.922389 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:04:06.927585 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:04:06.929638 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:04:06.933350 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:04:06.935539 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:04:06.935539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m07:04:06.936074 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.936074 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.936074 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:04:06.936074 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:06.947292 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m07:04:06.949384 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m07:04:06.951607 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m07:04:06.951607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m07:04:06.952636 [info ] [Thread-1 (]: 14 of 51 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:04:06.953620 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:04:06.953620 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:04:06.953620 [info ] [Thread-1 (]: 15 of 51 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:04:06.954706 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m07:04:06.955709 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:04:06.961232 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:04:06.964297 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:04:06.966941 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:04:06.967946 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:04:06.967946 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m07:04:06.968965 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.969471 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:06.969471 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:04:06.969471 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:06.974697 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:04:06.976290 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m07:04:06.976926 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m07:04:06.977931 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m07:04:06.977931 [info ] [Thread-1 (]: 15 of 51 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:04:06.977931 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:04:06.977931 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:04:06.979434 [info ] [Thread-1 (]: 16 of 51 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:04:06.979997 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m07:04:06.979997 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:04:06.986425 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:04:06.987945 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:04:06.990121 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:04:06.992166 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:04:06.992676 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m07:04:06.992676 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:06.993189 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:06.993189 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:04:06.994838 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.001478 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:04:07.002499 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m07:04:07.004022 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m07:04:07.005616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m07:04:07.005616 [info ] [Thread-1 (]: 16 of 51 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:04:07.006644 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:04:07.007644 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:04:07.008374 [info ] [Thread-1 (]: 17 of 51 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:04:07.008374 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m07:04:07.009899 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:04:07.016300 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:04:07.018012 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:04:07.020543 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:04:07.022121 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:04:07.022121 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m07:04:07.022121 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.023632 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.023632 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:04:07.023632 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.029767 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:04:07.032124 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m07:04:07.033137 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m07:04:07.033137 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m07:04:07.034176 [info ] [Thread-1 (]: 17 of 51 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:04:07.034176 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:04:07.034775 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:04:07.035304 [info ] [Thread-1 (]: 18 of 51 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m07:04:07.035304 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m07:04:07.035304 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:04:07.043551 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:04:07.044562 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:04:07.046854 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:04:07.047643 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:04:07.047643 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m07:04:07.047643 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.048650 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.048650 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:04:07.048650 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:04:07.052554 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:04:07.054075 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m07:04:07.054725 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m07:04:07.054725 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m07:04:07.055732 [info ] [Thread-1 (]: 18 of 51 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m07:04:07.056237 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:04:07.057242 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:04:07.057242 [info ] [Thread-1 (]: 19 of 51 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m07:04:07.058242 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m07:04:07.058242 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:04:07.062040 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:04:07.063524 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:04:07.066034 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:04:07.067135 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:04:07.067135 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m07:04:07.067135 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.067135 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.068685 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:04:07.068685 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.069695 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.071388 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m07:04:07.071914 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m07:04:07.073704 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m07:04:07.074250 [info ] [Thread-1 (]: 19 of 51 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m07:04:07.074864 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:04:07.075387 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:04:07.075387 [info ] [Thread-1 (]: 20 of 51 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m07:04:07.075387 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m07:04:07.075387 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:04:07.081900 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:04:07.084067 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:04:07.085619 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:04:07.086123 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:04:07.087637 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m07:04:07.087637 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.088215 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.088215 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:04:07.088215 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.089730 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.091254 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m07:04:07.092276 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m07:04:07.093429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m07:04:07.093429 [info ] [Thread-1 (]: 20 of 51 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m07:04:07.093429 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:04:07.093429 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:04:07.095037 [info ] [Thread-1 (]: 21 of 51 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m07:04:07.095037 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m07:04:07.095037 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:04:07.098561 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:04:07.099716 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:04:07.101830 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:04:07.102446 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:04:07.102446 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m07:04:07.102446 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.104011 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.104011 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:04:07.104011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:04:07.106621 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.107637 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m07:04:07.108638 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m07:04:07.108638 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m07:04:07.109637 [info ] [Thread-1 (]: 21 of 51 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.01s]
[0m07:04:07.110285 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:04:07.110851 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:04:07.110851 [info ] [Thread-1 (]: 22 of 51 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m07:04:07.111855 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m07:04:07.111855 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:04:07.115387 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:04:07.117451 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:04:07.120551 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:04:07.121079 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:04:07.121079 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m07:04:07.122092 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.122092 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.123098 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:04:07.123098 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.123627 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.124670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m07:04:07.125297 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m07:04:07.125297 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m07:04:07.126326 [info ] [Thread-1 (]: 22 of 51 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m07:04:07.126326 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:04:07.127324 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:04:07.127324 [info ] [Thread-1 (]: 23 of 51 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:04:07.128308 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m07:04:07.128308 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:04:07.132641 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:04:07.133724 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:04:07.135403 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:04:07.136410 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:04:07.137414 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m07:04:07.137414 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.137923 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.138460 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:04:07.138460 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.141202 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.142230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m07:04:07.142230 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m07:04:07.143329 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m07:04:07.143329 [info ] [Thread-1 (]: 23 of 51 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:04:07.143329 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:04:07.143329 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:04:07.143329 [info ] [Thread-1 (]: 24 of 51 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:04:07.144883 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m07:04:07.144883 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:04:07.148668 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:04:07.150051 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:04:07.151783 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:04:07.152793 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:04:07.152793 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m07:04:07.152793 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.153795 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.154300 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:04:07.154300 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.156916 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.157897 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m07:04:07.157897 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m07:04:07.159417 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m07:04:07.159417 [info ] [Thread-1 (]: 24 of 51 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m07:04:07.159968 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:04:07.160562 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:04:07.160562 [info ] [Thread-1 (]: 25 of 51 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:04:07.160562 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m07:04:07.161587 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:04:07.164680 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:04:07.165855 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:04:07.167588 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:04:07.168599 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:04:07.168599 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m07:04:07.169102 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.169608 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.169608 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:04:07.169608 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.171808 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.173390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m07:04:07.173390 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m07:04:07.174418 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m07:04:07.174418 [info ] [Thread-1 (]: 25 of 51 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m07:04:07.175024 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:04:07.175024 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:04:07.175024 [info ] [Thread-1 (]: 26 of 51 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:04:07.176034 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m07:04:07.176034 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:04:07.179558 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:04:07.180746 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:04:07.181762 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:04:07.183303 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:04:07.183303 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m07:04:07.183909 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.184447 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.184447 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:04:07.184447 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.188021 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.188568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m07:04:07.189597 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m07:04:07.190128 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m07:04:07.190128 [info ] [Thread-1 (]: 26 of 51 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m07:04:07.191133 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:04:07.191133 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:04:07.191133 [info ] [Thread-1 (]: 27 of 51 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:04:07.192137 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m07:04:07.192137 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:04:07.197178 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:04:07.197178 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:04:07.199886 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:04:07.200892 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:04:07.201399 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m07:04:07.201399 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.202403 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.202403 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:04:07.202403 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.203911 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.205498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m07:04:07.205498 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m07:04:07.206528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m07:04:07.206528 [info ] [Thread-1 (]: 27 of 51 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m07:04:07.206528 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:04:07.207509 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:04:07.207509 [info ] [Thread-1 (]: 28 of 51 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:04:07.208508 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m07:04:07.208508 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:04:07.211937 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:04:07.213443 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:04:07.215450 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:04:07.215450 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:04:07.216454 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m07:04:07.216957 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.216957 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.216957 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:04:07.217984 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.219464 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.220971 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m07:04:07.221975 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m07:04:07.221975 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m07:04:07.222997 [info ] [Thread-1 (]: 28 of 51 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m07:04:07.222997 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:04:07.222997 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:04:07.222997 [info ] [Thread-1 (]: 29 of 51 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:04:07.222997 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m07:04:07.224589 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:04:07.228158 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:04:07.228158 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:04:07.230657 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:04:07.231162 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:04:07.231745 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m07:04:07.231745 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.231745 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.231745 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:04:07.231745 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.236003 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:04:07.236003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m07:04:07.238150 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m07:04:07.238150 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m07:04:07.238150 [info ] [Thread-1 (]: 29 of 51 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:04:07.238909 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:04:07.239462 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:04:07.239462 [info ] [Thread-1 (]: 30 of 51 START test unique_dim_tempo_id_data ................................... [RUN]
[0m07:04:07.239462 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m07:04:07.239462 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:04:07.242562 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:04:07.243647 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:04:07.246165 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:04:07.247400 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:04:07.247400 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m07:04:07.249127 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.250659 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.251707 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:04:07.251707 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:04:07.254718 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:04:07.257823 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m07:04:07.257823 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m07:04:07.257823 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m07:04:07.259351 [info ] [Thread-1 (]: 30 of 51 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.02s]
[0m07:04:07.259896 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:04:07.260474 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:04:07.260474 [info ] [Thread-1 (]: 31 of 51 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m07:04:07.260474 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m07:04:07.261478 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:04:07.263622 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:04:07.264651 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:04:07.267925 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:04:07.269430 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:04:07.269430 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m07:04:07.269430 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.270946 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.270946 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:04:07.270946 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.271981 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.273683 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m07:04:07.274272 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m07:04:07.274824 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m07:04:07.275999 [info ] [Thread-1 (]: 31 of 51 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.02s]
[0m07:04:07.276633 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:04:07.277182 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:04:07.277182 [info ] [Thread-1 (]: 32 of 51 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m07:04:07.278192 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m07:04:07.278192 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:04:07.282018 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:04:07.284859 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:04:07.286509 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:04:07.288208 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:04:07.288208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m07:04:07.289750 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.290403 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.290403 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:04:07.290922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.290922 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.293371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m07:04:07.295110 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m07:04:07.296121 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m07:04:07.296623 [info ] [Thread-1 (]: 32 of 51 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m07:04:07.297353 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:04:07.298357 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:04:07.298859 [info ] [Thread-1 (]: 33 of 51 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:04:07.299368 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m07:04:07.299368 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:04:07.305908 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:04:07.306944 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:04:07.310030 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:04:07.311783 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:04:07.311783 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m07:04:07.311783 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.311783 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.311783 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:04:07.313310 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.317001 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:04:07.319025 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m07:04:07.320561 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m07:04:07.320561 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m07:04:07.321066 [info ] [Thread-1 (]: 33 of 51 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:04:07.321066 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:04:07.322073 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:04:07.322073 [info ] [Thread-1 (]: 34 of 51 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:04:07.322073 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m07:04:07.324031 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:04:07.329747 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:04:07.331514 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:04:07.333121 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:04:07.334886 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:04:07.335604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m07:04:07.335604 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.335604 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.336631 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:04:07.336631 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.343249 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:04:07.344894 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m07:04:07.346517 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m07:04:07.346517 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m07:04:07.347524 [info ] [Thread-1 (]: 34 of 51 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:04:07.348029 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:04:07.348029 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:04:07.348533 [info ] [Thread-1 (]: 35 of 51 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m07:04:07.348533 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m07:04:07.349168 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:04:07.351739 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.352769 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:04:07.357695 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.358711 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.359711 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m07:04:07.359711 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.360325 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.360325 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.360325 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m07:04:07.361857 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.363377 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.363377 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:04:07.364405 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.365502 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.366033 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:04:07.367120 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.372130 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.373164 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao" rename to "dim_classe_instituicao__dbt_backup"
[0m07:04:07.373696 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.377392 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.378393 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m07:04:07.379376 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.379878 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:04:07.379878 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.379878 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:04:07.383123 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.384928 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:04:07.385519 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m07:04:07.386051 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.387595 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m07:04:07.388400 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021763AB4D10>]}
[0m07:04:07.388400 [info ] [Thread-1 (]: 35 of 51 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.04s]
[0m07:04:07.389406 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:04:07.389406 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:04:07.389910 [info ] [Thread-1 (]: 36 of 51 START sql table model main.dim_consolidado ............................ [RUN]
[0m07:04:07.389910 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m07:04:07.389910 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m07:04:07.393859 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.394869 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m07:04:07.399295 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.399995 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.399995 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m07:04:07.401001 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.401507 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.401507 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.401507 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m07:04:07.402532 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.402532 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.404056 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:04:07.404056 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.406766 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.406766 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:04:07.407766 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.412054 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.413035 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m07:04:07.413538 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.416929 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.417933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m07:04:07.418933 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.420483 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:04:07.421019 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.421019 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:04:07.422598 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.424874 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:04:07.424874 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m07:04:07.426506 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.427510 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m07:04:07.427510 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021763A80350>]}
[0m07:04:07.429049 [info ] [Thread-1 (]: 36 of 51 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.04s]
[0m07:04:07.430094 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:04:07.430094 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m07:04:07.430683 [info ] [Thread-1 (]: 37 of 51 START sql table model main.dim_controle ............................... [RUN]
[0m07:04:07.431200 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m07:04:07.431808 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m07:04:07.433826 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.434830 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m07:04:07.438665 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.439690 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.439690 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m07:04:07.440222 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.440222 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.440222 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.441228 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m07:04:07.441228 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.442231 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.443327 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:04:07.443865 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.443865 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.444888 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:04:07.444888 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.447681 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.447681 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m07:04:07.447681 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.451377 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.452407 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m07:04:07.452407 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.453930 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:04:07.453930 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.453930 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:04:07.455617 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.457623 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:04:07.457623 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m07:04:07.458622 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.459646 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m07:04:07.460284 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021763A80500>]}
[0m07:04:07.460871 [info ] [Thread-1 (]: 37 of 51 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.03s]
[0m07:04:07.460871 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m07:04:07.461876 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m07:04:07.461876 [info ] [Thread-1 (]: 38 of 51 START sql table model main.dim_segmento ............................... [RUN]
[0m07:04:07.462541 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_segmento)
[0m07:04:07.463051 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m07:04:07.464663 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.465822 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m07:04:07.468274 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.469279 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.469279 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m07:04:07.469279 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.469279 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.471017 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.471017 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m07:04:07.472024 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.472529 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.472529 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:04:07.473536 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.474543 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.474543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:04:07.475049 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.477834 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.477834 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m07:04:07.477834 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.481000 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.481000 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m07:04:07.482197 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.483204 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:04:07.483204 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.483709 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:04:07.484372 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.486092 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:04:07.486092 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m07:04:07.487596 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.488898 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m07:04:07.489417 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021764C06330>]}
[0m07:04:07.489417 [info ] [Thread-1 (]: 38 of 51 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m07:04:07.489417 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m07:04:07.489417 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:04:07.490929 [info ] [Thread-1 (]: 39 of 51 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m07:04:07.490929 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m07:04:07.491935 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:04:07.496213 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:04:07.496835 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:04:07.497407 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:04:07.499659 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:04:07.499659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m07:04:07.499659 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.500664 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.501169 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:04:07.501169 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.501750 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.502757 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m07:04:07.503756 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m07:04:07.504261 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m07:04:07.504261 [info ] [Thread-1 (]: 39 of 51 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m07:04:07.504261 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:04:07.504261 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:04:07.505766 [info ] [Thread-1 (]: 40 of 51 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m07:04:07.505766 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m07:04:07.505766 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:04:07.510810 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:04:07.511814 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:04:07.513332 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:04:07.514880 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:04:07.514880 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m07:04:07.515402 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.515402 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.515402 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:04:07.516414 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.517180 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.519719 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m07:04:07.519719 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m07:04:07.520730 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m07:04:07.521234 [info ] [Thread-1 (]: 40 of 51 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:04:07.521234 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:04:07.522259 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:04:07.522259 [info ] [Thread-1 (]: 41 of 51 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m07:04:07.522259 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m07:04:07.523270 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:04:07.525870 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:04:07.526899 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:04:07.527897 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:04:07.529420 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:04:07.529985 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m07:04:07.529985 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.531009 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.532111 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:04:07.532641 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:04:07.535410 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:04:07.536440 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m07:04:07.537962 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m07:04:07.537962 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m07:04:07.538667 [info ] [Thread-1 (]: 41 of 51 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m07:04:07.538667 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:04:07.539681 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:04:07.539681 [info ] [Thread-1 (]: 42 of 51 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m07:04:07.539681 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m07:04:07.539681 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:04:07.543398 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:04:07.545171 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:04:07.546783 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:04:07.547387 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:04:07.547387 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m07:04:07.548416 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.549025 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.549025 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:04:07.549549 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.549549 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.551889 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m07:04:07.551889 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m07:04:07.552918 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m07:04:07.552918 [info ] [Thread-1 (]: 42 of 51 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m07:04:07.552918 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:04:07.553901 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:04:07.553901 [info ] [Thread-1 (]: 43 of 51 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m07:04:07.555411 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m07:04:07.555411 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:04:07.559489 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:04:07.560547 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:04:07.562103 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:04:07.563087 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:04:07.563087 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m07:04:07.563589 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.563589 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.563589 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:04:07.563589 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.565595 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.566603 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m07:04:07.567630 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m07:04:07.567630 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m07:04:07.567630 [info ] [Thread-1 (]: 43 of 51 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.01s]
[0m07:04:07.567630 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:04:07.569136 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:04:07.569136 [info ] [Thread-1 (]: 44 of 51 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m07:04:07.569683 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m07:04:07.570688 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:04:07.574778 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:04:07.575624 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:04:07.576646 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:04:07.577627 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:04:07.578644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m07:04:07.578644 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.579149 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.579656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:04:07.579656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:04:07.581439 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.582011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m07:04:07.583775 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m07:04:07.583775 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m07:04:07.585960 [info ] [Thread-1 (]: 44 of 51 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m07:04:07.586493 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:04:07.586493 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:04:07.586493 [info ] [Thread-1 (]: 45 of 51 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m07:04:07.587498 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m07:04:07.588003 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:04:07.591164 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:04:07.591164 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:04:07.593779 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:04:07.595457 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:04:07.595981 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m07:04:07.595981 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.595981 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.596992 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:04:07.596992 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.597494 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.598496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m07:04:07.599501 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m07:04:07.600004 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m07:04:07.600723 [info ] [Thread-1 (]: 45 of 51 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.01s]
[0m07:04:07.601291 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:04:07.601291 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:04:07.601291 [info ] [Thread-1 (]: 46 of 51 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m07:04:07.601993 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m07:04:07.601993 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:04:07.605824 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:04:07.608416 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:04:07.610499 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:04:07.610923 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:04:07.611531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m07:04:07.611531 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.611531 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.612513 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:04:07.612513 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.614294 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.615516 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m07:04:07.616631 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m07:04:07.617146 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m07:04:07.617146 [info ] [Thread-1 (]: 46 of 51 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m07:04:07.617146 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:04:07.617146 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:04:07.618657 [info ] [Thread-1 (]: 47 of 51 START test unique_dim_controle_id_controle ............................ [RUN]
[0m07:04:07.618657 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m07:04:07.618657 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:04:07.622226 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:04:07.623255 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:04:07.625052 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:04:07.625052 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:04:07.626064 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m07:04:07.626064 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.626064 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.626064 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:04:07.627083 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:04:07.628063 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.629587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m07:04:07.629587 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m07:04:07.629587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m07:04:07.631263 [info ] [Thread-1 (]: 47 of 51 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.01s]
[0m07:04:07.631872 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:04:07.631872 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:04:07.632396 [info ] [Thread-1 (]: 48 of 51 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m07:04:07.632907 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m07:04:07.632907 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:04:07.635663 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:04:07.636692 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:04:07.639829 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:04:07.642555 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:04:07.642555 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m07:04:07.643071 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.643585 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.643585 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:04:07.643585 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.644602 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.645131 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m07:04:07.646153 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m07:04:07.646153 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m07:04:07.646826 [info ] [Thread-1 (]: 48 of 51 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.01s]
[0m07:04:07.647429 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:04:07.647429 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:04:07.647994 [info ] [Thread-1 (]: 49 of 51 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m07:04:07.648526 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m07:04:07.649104 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:04:07.653015 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:04:07.654013 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:04:07.656325 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:04:07.657486 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:04:07.658002 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m07:04:07.658002 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.658537 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.658537 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:04:07.659076 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:04:07.660687 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.661239 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m07:04:07.663253 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m07:04:07.663253 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m07:04:07.664393 [info ] [Thread-1 (]: 49 of 51 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m07:04:07.665901 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:04:07.666404 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:04:07.666932 [info ] [Thread-1 (]: 50 of 51 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m07:04:07.667936 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m07:04:07.667936 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:04:07.670964 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:04:07.673108 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:04:07.675251 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:04:07.676256 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:04:07.676256 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m07:04:07.676256 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.677374 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.678066 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:04:07.678066 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:04:07.680198 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.683132 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m07:04:07.683938 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m07:04:07.683938 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m07:04:07.685055 [info ] [Thread-1 (]: 50 of 51 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m07:04:07.685055 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:04:07.685698 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m07:04:07.686816 [info ] [Thread-1 (]: 51 of 51 START sql view model main.view_balanco_patrimonial_relatorios ......... [RUN]
[0m07:04:07.686816 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios)
[0m07:04:07.686816 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m07:04:07.691579 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:04:07.692181 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m07:04:07.706817 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:04:07.707818 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:04:07.707818 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: BEGIN
[0m07:04:07.707818 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:04:07.707818 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.709323 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:04:07.709323 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */

  
  create view "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_balanco_patrimonial"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
),
dim_classe AS (
    SELECT * FROM "gold_warehouse"."main"."dim_classe_instituicao"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    cl.descricao as classe_instituicao,
    
    -- Data
    t.data as data_base,
    
    -- Fatos Ativo
    f.disponibilidades,
    f.aplicacoes_interfinanceiras_liquidez,
    f.tvm_derivativos,
    f.operacoes_de_credito,
    f.provisao_operacoes_de_credito,
    f.operacoes_de_credito_liquidas_provisao,
    f.arrendamento_mercantil_a_receber,
    f.imobilizado_de_arrendamento,
    f.credores_antecipacao_valor_residual,
    f.provisao_arrendamento_mercantil,
    f.arrendamento_mercantil_liquido_de_provisao,
    f.outros_creditos_liquido_de_provisao,
    f.outros_ativos_realizaveis,
    f.permanente_ajustado,
    f.ativo_total_ajustado,
    f.ativo_total,
    
    -- Fatos Passivo
    f.depositos_vista,
    f.depositos_poupanca,
    f.depositos_interfinanceiros,
    f.depositos_a_prazo,
    f.conta_de_pagamento_pre_paga,
    f.depositos_outros,
    f.depositos,
    f.captacoes_mercado_aberto,
    f.letras_de_credito_imobiliario,
    f.letras_de_credito_agronegocio,
    f.letras_financeiras,
    f.obrigacoes_titulos_e_valores_mobiliarios_exterior,
    f.outros_recursos_de_aceites_e_emissao_de_titulos,
    f.recursos_aceites_cambiais,
    f.obrigacoes_emprestimos_repasses,
    f.captacoes,
    f.obrigacoes_por_instr_financeiros_derivativos,
    f.outras_obrigacoes,
    f.passivo_circulante_exigivel_longo_prazo,
    f.patrimonio_liquido,
    f.passivo_total

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
LEFT JOIN dim_classe cl ON i.id_classe = cl.id_classe
  );

[0m07:04:07.711166 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:04:07.713671 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:04:07.713671 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */
alter view "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_tmp" rename to "view_balanco_patrimonial_relatorios"
[0m07:04:07.714673 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.715879 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: COMMIT
[0m07:04:07.715879 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:04:07.715879 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: COMMIT
[0m07:04:07.717390 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:04:07.719634 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:04:07.721481 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_backup" cascade
    
[0m07:04:07.721984 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:04:07.721984 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: Close
[0m07:04:07.721984 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '830cab07-f9be-4a88-9bd5-b637fd898737', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021762F164E0>]}
[0m07:04:07.723884 [info ] [Thread-1 (]: 51 of 51 OK created sql view model main.view_balanco_patrimonial_relatorios .... [[32mOK[0m in 0.04s]
[0m07:04:07.723884 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m07:04:07.725967 [debug] [MainThread]: Using duckdb connection "master"
[0m07:04:07.725967 [debug] [MainThread]: On master: BEGIN
[0m07:04:07.725967 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m07:04:07.726998 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m07:04:07.726998 [debug] [MainThread]: On master: COMMIT
[0m07:04:07.727980 [debug] [MainThread]: Using duckdb connection "master"
[0m07:04:07.727980 [debug] [MainThread]: On master: COMMIT
[0m07:04:07.727980 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:04:07.727980 [debug] [MainThread]: On master: Close
[0m07:04:07.729000 [debug] [MainThread]: Connection 'master' was properly closed.
[0m07:04:07.729000 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m07:04:07.729505 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m07:04:07.729505 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios' was properly closed.
[0m07:04:07.730012 [info ] [MainThread]: 
[0m07:04:07.730012 [info ] [MainThread]: Finished running 4 seeds, 8 table models, 38 data tests, 1 view model in 0 hours 0 minutes and 3.91 seconds (3.91s).
[0m07:04:07.734815 [debug] [MainThread]: Command end result
[0m07:04:07.781952 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:04:07.786166 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:04:07.792102 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m07:04:07.793782 [info ] [MainThread]: 
[0m07:04:07.793782 [info ] [MainThread]: [32mCompleted successfully[0m
[0m07:04:07.793782 [info ] [MainThread]: 
[0m07:04:07.794787 [info ] [MainThread]: Done. PASS=51 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=51
[0m07:04:07.794787 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 2 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m07:04:07.796398 [debug] [MainThread]: Command `dbt build` succeeded at 07:04:07.794787 after 5.52 seconds
[0m07:04:07.796398 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021761310710>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000217613107A0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000021761313410>]}
[0m07:04:07.796986 [debug] [MainThread]: Flushing usage events
[0m07:04:08.725408 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m07:05:50.193297 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282A73DE000>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AA057920>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282A9A7BC20>]}


============================== 07:05:50.198641 | ebe0c4b9-bd1e-4b8d-9d2d-375a02539265 ==============================
[0m07:05:50.198641 [info ] [MainThread]: Running with dbt=1.11.5
[0m07:05:50.199690 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'indirect_selection': 'eager', 'use_colors': 'True', 'invocation_command': 'dbt build --select +view_balanco_patrimonial_relatorios', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m07:05:50.405820 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282ABBC16D0>]}
[0m07:05:50.452472 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AAA83F20>]}
[0m07:05:50.455525 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m07:05:50.675199 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m07:05:50.832203 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed.
[0m07:05:50.832203 [debug] [MainThread]: Nothing changed, skipping partial parsing.
[0m07:05:50.832203 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing
[0m07:05:50.838625 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m07:05:50.876835 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AC26FE30>]}
[0m07:05:50.963632 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:05:50.965472 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:05:51.059394 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282ABCF5B20>]}
[0m07:05:51.059946 [info ] [MainThread]: Found 28 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m07:05:51.064317 [info ] [MainThread]: 
[0m07:05:51.064639 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m07:05:51.065643 [info ] [MainThread]: 
[0m07:05:51.066220 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m07:05:51.069432 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m07:05:51.146088 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m07:05:51.146673 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m07:05:51.146673 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:05:51.279670 [debug] [ThreadPool]: SQL status: OK in 0.134 seconds
[0m07:05:51.281471 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m07:05:51.282185 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m07:05:51.282185 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m07:05:51.288375 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:05:51.288375 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m07:05:51.288375 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m07:05:51.289382 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m07:05:51.289889 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:05:51.290892 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m07:05:51.290892 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:05:51.290892 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:05:51.290892 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m07:05:51.293115 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:05:51.293423 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:05:51.293423 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:05:51.293423 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:05:51.294931 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:05:51.294931 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m07:05:51.297319 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m07:05:51.301067 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:05:51.301067 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m07:05:51.301716 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:05:51.302033 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:05:51.302033 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:05:51.302733 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m07:05:51.312342 [debug] [ThreadPool]: SQL status: OK in 0.010 seconds
[0m07:05:51.314329 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m07:05:51.314329 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m07:05:51.314329 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m07:05:51.318740 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282A6AA2120>]}
[0m07:05:51.319247 [debug] [MainThread]: Using duckdb connection "master"
[0m07:05:51.319247 [debug] [MainThread]: On master: BEGIN
[0m07:05:51.319773 [debug] [MainThread]: Opening a new connection, currently in state init
[0m07:05:51.319773 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:05:51.319773 [debug] [MainThread]: On master: COMMIT
[0m07:05:51.320784 [debug] [MainThread]: Using duckdb connection "master"
[0m07:05:51.320784 [debug] [MainThread]: On master: COMMIT
[0m07:05:51.320784 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:05:51.320784 [debug] [MainThread]: On master: Close
[0m07:05:51.324787 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:05:51.325809 [info ] [Thread-1 (]: 1 of 51 START sql table model main.dim_instituicao ............................. [RUN]
[0m07:05:51.325809 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m07:05:51.325809 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m07:05:51.340806 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.341336 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m07:05:51.373588 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.374726 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.375278 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m07:05:51.375278 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m07:05:51.376310 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:51.376310 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.378308 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m07:05:51.912204 [debug] [Thread-1 (]: SQL status: OK in 0.531 seconds
[0m07:05:51.916909 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.916909 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:05:51.917915 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:51.918916 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.919421 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:05:51.919421 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:51.925093 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.925093 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m07:05:51.926098 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:51.929121 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.929631 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m07:05:51.929631 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:51.941296 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:05:51.942333 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.942842 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:05:51.961917 [debug] [Thread-1 (]: SQL status: OK in 0.019 seconds
[0m07:05:51.966933 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:05:51.966933 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m07:05:51.967963 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:51.970720 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m07:05:51.972230 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282ABBEA3F0>]}
[0m07:05:51.973237 [info ] [Thread-1 (]: 1 of 51 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.64s]
[0m07:05:51.974247 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:05:51.974845 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:05:51.974845 [info ] [Thread-1 (]: 2 of 51 START sql table model main.dim_localizacao ............................. [RUN]
[0m07:05:51.975486 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m07:05:51.975486 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m07:05:51.978492 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:51.979493 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m07:05:51.982015 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:51.983021 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:51.983021 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m07:05:51.983526 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:51.984040 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:51.984714 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:51.984714 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m07:05:52.060541 [debug] [Thread-1 (]: SQL status: OK in 0.075 seconds
[0m07:05:52.061561 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:52.062091 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:05:52.062091 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.063114 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:52.063114 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:05:52.063114 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.066931 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:52.067973 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m07:05:52.067973 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.070488 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:52.070488 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m07:05:52.070488 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.072172 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:05:52.072172 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:52.072172 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:05:52.075169 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:52.076692 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:05:52.076692 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m07:05:52.077720 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:52.079243 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m07:05:52.079776 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AC67BDA0>]}
[0m07:05:52.079776 [info ] [Thread-1 (]: 2 of 51 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.10s]
[0m07:05:52.081376 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:05:52.081376 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m07:05:52.081944 [info ] [Thread-1 (]: 3 of 51 START sql table model main.dim_tempo ................................... [RUN]
[0m07:05:52.082948 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m07:05:52.082948 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m07:05:52.090306 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.091331 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m07:05:52.094604 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.095142 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.095142 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m07:05:52.096163 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:52.096163 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.096832 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.096832 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m07:05:52.158607 [debug] [Thread-1 (]: SQL status: OK in 0.061 seconds
[0m07:05:52.159608 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.160114 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:05:52.160717 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:52.161722 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.161722 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:05:52.163227 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.165309 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.165899 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m07:05:52.166467 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.169079 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.169582 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m07:05:52.169582 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.170601 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:05:52.170601 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.170601 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:05:52.172354 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:52.174920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:05:52.174920 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m07:05:52.175484 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:52.176499 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m07:05:52.177496 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AC1E8050>]}
[0m07:05:52.177496 [info ] [Thread-1 (]: 3 of 51 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m07:05:52.178516 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m07:05:52.179513 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:05:52.180040 [info ] [Thread-1 (]: 4 of 51 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m07:05:52.181599 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m07:05:52.182121 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:05:52.186390 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.187913 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:05:52.190262 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.191283 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.192299 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m07:05:52.192299 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:52.192829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.193335 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.193335 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos (Prudential version with accents on some cols)
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    
    -- Passivos (Novas Contas Inseridas)
    depositos_vista,
    depositos_poupanca,
    depositos_interfinanceiros,
    depositos_a_prazo,
    conta_de_pagamento_pre_paga,
    depositos_outros,
    depositos,
    captacoes_mercado_aberto,
    letras_de_credito_imobiliario,
    letras_de_credito_agronegocio,
    letras_financeiras,
    obrigacoes_titulos_e_valores_mobiliarios_exterior,
    outros_recursos_de_aceites_e_emissao_de_titulos,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    captacoes,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total

FROM unificacao
    );
  
  
[0m07:05:52.950264 [debug] [Thread-1 (]: SQL status: OK in 0.756 seconds
[0m07:05:52.951559 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.951559 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m07:05:52.952673 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.952673 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.954287 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m07:05:52.955294 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:52.957018 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.957963 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial" rename to "fato_balanco_patrimonial__dbt_backup"
[0m07:05:52.957963 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.960189 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.960189 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m07:05:52.960189 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:52.961839 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:05:52.962545 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:52.962545 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m07:05:53.133872 [debug] [Thread-1 (]: SQL status: OK in 0.171 seconds
[0m07:05:53.135385 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m07:05:53.135385 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m07:05:53.136391 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.138882 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m07:05:53.139406 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AC66F8F0>]}
[0m07:05:53.139406 [info ] [Thread-1 (]: 4 of 51 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.96s]
[0m07:05:53.139406 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m07:05:53.140921 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:05:53.140921 [info ] [Thread-1 (]: 5 of 51 START seed file main.seed_dim_classe_instituicao ....................... [RUN]
[0m07:05:53.141928 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m07:05:53.141928 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:05:53.141928 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:05:53.163920 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:05:53.163920 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m07:05:53.165022 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.165733 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.165733 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:05:53.166394 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */
truncate table "gold_warehouse"."main"."seed_dim_classe_instituicao"
[0m07:05:53.166959 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.175306 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:05:53.175306 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:05:53.180038 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:05:53.184420 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:05:53.185931 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:05:53.185931 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:05:53.187540 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:05:53.189468 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.191010 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m07:05:53.191010 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AD77C290>]}
[0m07:05:53.192035 [info ] [Thread-1 (]: 5 of 51 OK loaded seed file main.seed_dim_classe_instituicao ................... [[32mINSERT 32[0m in 0.05s]
[0m07:05:53.193127 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:05:53.193127 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:05:53.193127 [info ] [Thread-1 (]: 6 of 51 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m07:05:53.194670 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m07:05:53.194670 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:05:53.196366 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:05:53.204769 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:05:53.205787 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m07:05:53.206936 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.207920 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.207920 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:05:53.207920 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m07:05:53.209424 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:53.210940 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:05:53.211594 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:05:53.214075 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.215586 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:05:53.221206 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:05:53.221206 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:05:53.222320 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:05:53.225183 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.225183 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m07:05:53.226298 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AC0727B0>]}
[0m07:05:53.227314 [info ] [Thread-1 (]: 6 of 51 OK loaded seed file main.seed_dim_consolidado .......................... [[32mINSERT 8[0m in 0.03s]
[0m07:05:53.228192 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:05:53.228192 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:05:53.229703 [info ] [Thread-1 (]: 7 of 51 START seed file main.seed_dim_controle ................................. [RUN]
[0m07:05:53.232130 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m07:05:53.233988 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:05:53.235504 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:05:53.246755 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:05:53.247844 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m07:05:53.248643 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.249916 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.251443 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:05:53.252457 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m07:05:53.254367 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.255923 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:05:53.256542 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:05:53.260636 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:05:53.261645 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:05:53.267171 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:05:53.267171 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:05:53.268838 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:05:53.271162 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.272295 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m07:05:53.272295 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AD785C70>]}
[0m07:05:53.273521 [info ] [Thread-1 (]: 7 of 51 OK loaded seed file main.seed_dim_controle ............................. [[32mINSERT 3[0m in 0.04s]
[0m07:05:53.274526 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:05:53.275150 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:05:53.276258 [info ] [Thread-1 (]: 8 of 51 START seed file main.seed_dim_segmento ................................. [RUN]
[0m07:05:53.277156 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m07:05:53.277156 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:05:53.277156 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:05:53.283844 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:05:53.285041 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m07:05:53.285041 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.285568 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:53.285568 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:05:53.285568 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m07:05:53.286580 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:53.287580 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:05:53.287580 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:05:53.288242 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.289757 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:05:53.292775 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:05:53.293277 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:05:53.293277 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:05:53.296455 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:05:53.297110 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m07:05:53.297110 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AD7EA510>]}
[0m07:05:53.298845 [info ] [Thread-1 (]: 8 of 51 OK loaded seed file main.seed_dim_segmento ............................. [[32mINSERT 5[0m in 0.02s]
[0m07:05:53.299376 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:05:53.301000 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:05:53.301607 [info ] [Thread-1 (]: 9 of 51 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m07:05:53.301607 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m07:05:53.301607 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:05:53.313442 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:05:53.315592 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:05:53.338053 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:05:53.338655 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:05:53.339658 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m07:05:53.340164 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.341168 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.341168 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:05:53.342172 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.342172 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.345475 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m07:05:53.346483 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m07:05:53.346483 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m07:05:53.347216 [info ] [Thread-1 (]: 9 of 51 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.05s]
[0m07:05:53.347216 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:05:53.348987 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:05:53.349499 [info ] [Thread-1 (]: 10 of 51 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m07:05:53.349499 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m07:05:53.349499 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:05:53.352999 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:05:53.354489 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:05:53.357622 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:05:53.358609 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:05:53.359557 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m07:05:53.360470 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.361118 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.361118 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:05:53.362202 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.365479 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.367244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m07:05:53.369421 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m07:05:53.369421 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m07:05:53.370932 [info ] [Thread-1 (]: 10 of 51 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m07:05:53.371937 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:05:53.371937 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:05:53.371937 [info ] [Thread-1 (]: 11 of 51 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:05:53.371937 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m07:05:53.371937 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:05:53.379881 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:05:53.379881 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:05:53.381649 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:05:53.383264 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:05:53.383891 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m07:05:53.383891 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.384437 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.384437 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:05:53.385443 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.391964 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:05:53.393472 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m07:05:53.395112 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m07:05:53.396726 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m07:05:53.397247 [info ] [Thread-1 (]: 11 of 51 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:05:53.397247 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:05:53.398917 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:05:53.399433 [info ] [Thread-1 (]: 12 of 51 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:05:53.399433 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m07:05:53.400437 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:05:53.404016 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:05:53.405653 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:05:53.407661 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:05:53.409857 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:05:53.409857 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m07:05:53.410485 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.410485 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:53.410485 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:05:53.411492 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.415361 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:05:53.416876 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m07:05:53.417901 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m07:05:53.419391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m07:05:53.419391 [info ] [Thread-1 (]: 12 of 51 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:05:53.421216 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:05:53.422247 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:05:53.423262 [info ] [Thread-1 (]: 13 of 51 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:05:53.423262 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m07:05:53.423262 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:05:53.431133 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:05:53.431676 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:05:53.436510 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:05:53.439381 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:05:53.439381 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m07:05:53.440903 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.440903 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.440903 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:05:53.440903 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.446560 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:05:53.448916 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m07:05:53.451001 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m07:05:53.451694 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m07:05:53.451694 [info ] [Thread-1 (]: 13 of 51 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:05:53.452698 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:05:53.452698 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:05:53.452698 [info ] [Thread-1 (]: 14 of 51 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:05:53.453699 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m07:05:53.454772 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:05:53.461639 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:05:53.461639 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:05:53.463146 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:05:53.466680 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:05:53.468688 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m07:05:53.469198 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.470731 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.470731 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:05:53.471760 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.485486 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m07:05:53.488209 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m07:05:53.489721 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m07:05:53.490733 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m07:05:53.492250 [info ] [Thread-1 (]: 14 of 51 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m07:05:53.493257 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:05:53.493257 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:05:53.493257 [info ] [Thread-1 (]: 15 of 51 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:05:53.495190 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m07:05:53.495190 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:05:53.499058 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:05:53.500755 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:05:53.502844 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:05:53.503853 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:05:53.503853 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m07:05:53.505428 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.506459 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.506459 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:05:53.506459 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.509439 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.511773 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m07:05:53.513317 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m07:05:53.513317 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m07:05:53.514341 [info ] [Thread-1 (]: 15 of 51 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:05:53.515459 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:05:53.516672 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:05:53.517684 [info ] [Thread-1 (]: 16 of 51 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:05:53.519710 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m07:05:53.519710 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:05:53.530563 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:05:53.531571 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:05:53.536117 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:05:53.537627 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:05:53.538197 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m07:05:53.538197 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.539723 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.539723 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:05:53.541261 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.552053 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m07:05:53.554218 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m07:05:53.556995 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m07:05:53.556995 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m07:05:53.557996 [info ] [Thread-1 (]: 16 of 51 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m07:05:53.557996 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:05:53.557996 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:05:53.559501 [info ] [Thread-1 (]: 17 of 51 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:05:53.560674 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m07:05:53.560674 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:05:53.567284 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:05:53.568293 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:05:53.571998 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:05:53.573812 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:05:53.574526 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m07:05:53.575115 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.576122 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.576122 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:05:53.577126 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.592277 [debug] [Thread-1 (]: SQL status: OK in 0.015 seconds
[0m07:05:53.593369 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m07:05:53.595030 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m07:05:53.595030 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m07:05:53.595030 [info ] [Thread-1 (]: 17 of 51 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:05:53.596044 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:05:53.596942 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:05:53.596942 [info ] [Thread-1 (]: 18 of 51 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m07:05:53.598455 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m07:05:53.598455 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:05:53.602520 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:05:53.604026 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:05:53.607712 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:05:53.610822 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:05:53.611833 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m07:05:53.613337 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.614341 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.614843 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:05:53.614843 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:05:53.619435 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:05:53.621960 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m07:05:53.622490 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m07:05:53.623013 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m07:05:53.623560 [info ] [Thread-1 (]: 18 of 51 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.03s]
[0m07:05:53.624572 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:05:53.625077 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:05:53.625077 [info ] [Thread-1 (]: 19 of 51 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m07:05:53.626088 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m07:05:53.627107 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:05:53.632133 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:05:53.634211 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:05:53.637997 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:05:53.638716 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:05:53.639721 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m07:05:53.640227 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.640731 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.640731 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:05:53.642374 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.646119 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.647405 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m07:05:53.648990 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m07:05:53.649501 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m07:05:53.651783 [info ] [Thread-1 (]: 19 of 51 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.03s]
[0m07:05:53.654310 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:05:53.656379 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:05:53.657355 [info ] [Thread-1 (]: 20 of 51 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m07:05:53.659355 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m07:05:53.659859 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:05:53.674716 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:05:53.676254 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:05:53.681915 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:05:53.686745 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:05:53.687759 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m07:05:53.689505 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.692233 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:05:53.693242 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:05:53.694979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.699268 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:05:53.701893 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m07:05:53.704404 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m07:05:53.704404 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m07:05:53.705411 [info ] [Thread-1 (]: 20 of 51 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.05s]
[0m07:05:53.706421 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:05:53.707438 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:05:53.707438 [info ] [Thread-1 (]: 21 of 51 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m07:05:53.708453 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m07:05:53.709439 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:05:53.713323 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:05:53.714330 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:05:53.716425 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:05:53.717038 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:05:53.717038 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m07:05:53.718045 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.718045 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.719044 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:05:53.719044 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:05:53.720554 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.723174 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m07:05:53.723680 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m07:05:53.723680 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m07:05:53.724686 [info ] [Thread-1 (]: 21 of 51 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m07:05:53.725347 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:05:53.725347 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:05:53.726355 [info ] [Thread-1 (]: 22 of 51 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m07:05:53.726355 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m07:05:53.727356 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:05:53.731540 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:05:53.733611 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:05:53.739850 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:05:53.740857 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:05:53.740857 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m07:05:53.742588 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.743619 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.745015 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:05:53.746024 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.748065 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.749768 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m07:05:53.752377 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m07:05:53.753885 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m07:05:53.755505 [info ] [Thread-1 (]: 22 of 51 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.03s]
[0m07:05:53.756518 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:05:53.756518 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:05:53.757807 [info ] [Thread-1 (]: 23 of 51 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:05:53.757807 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m07:05:53.759851 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:05:53.765384 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:05:53.766390 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:05:53.769418 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:05:53.773464 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:05:53.775627 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m07:05:53.776166 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.776166 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.777161 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:05:53.777161 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.780176 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.783838 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m07:05:53.785359 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m07:05:53.785875 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m07:05:53.785875 [info ] [Thread-1 (]: 23 of 51 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:05:53.786883 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:05:53.787881 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:05:53.788386 [info ] [Thread-1 (]: 24 of 51 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:05:53.789392 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m07:05:53.789924 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:05:53.793507 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:05:53.796668 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:05:53.799918 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:05:53.801428 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:05:53.801428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m07:05:53.801428 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.803980 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.803980 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:05:53.805666 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.809287 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:05:53.810457 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m07:05:53.812467 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m07:05:53.813465 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m07:05:53.813970 [info ] [Thread-1 (]: 24 of 51 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:05:53.814815 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:05:53.815479 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:05:53.817736 [info ] [Thread-1 (]: 25 of 51 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:05:53.819022 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m07:05:53.819558 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:05:53.825376 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:05:53.826410 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:05:53.827918 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:05:53.831152 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:05:53.832166 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m07:05:53.833174 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.834237 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.834237 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:05:53.834887 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.837630 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.838768 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m07:05:53.839775 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m07:05:53.840280 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m07:05:53.840785 [info ] [Thread-1 (]: 25 of 51 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:05:53.840785 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:05:53.840785 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:05:53.842352 [info ] [Thread-1 (]: 26 of 51 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:05:53.843675 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m07:05:53.843675 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:05:53.848957 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:05:53.850482 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:05:53.855498 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:05:53.856505 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:05:53.857503 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m07:05:53.857503 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.858507 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.860533 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:05:53.860533 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.866591 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:05:53.867600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m07:05:53.869671 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m07:05:53.869671 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m07:05:53.870683 [info ] [Thread-1 (]: 26 of 51 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:05:53.872195 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:05:53.873220 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:05:53.873220 [info ] [Thread-1 (]: 27 of 51 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:05:53.874897 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m07:05:53.875640 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:05:53.882128 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:05:53.884964 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:05:53.888383 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:05:53.889915 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:05:53.890922 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m07:05:53.890922 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.891430 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:53.891430 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:05:53.891430 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.893444 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.893444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m07:05:53.895066 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m07:05:53.896583 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m07:05:53.897314 [info ] [Thread-1 (]: 27 of 51 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:05:53.897314 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:05:53.897314 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:05:53.897314 [info ] [Thread-1 (]: 28 of 51 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:05:53.899433 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m07:05:53.899433 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:05:53.905687 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:05:53.906693 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:05:53.911736 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:05:53.911736 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:05:53.913246 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m07:05:53.913246 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.914778 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.915286 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:05:53.915819 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.919083 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:05:53.921095 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m07:05:53.922100 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m07:05:53.922100 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m07:05:53.923105 [info ] [Thread-1 (]: 28 of 51 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:05:53.923105 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:05:53.923105 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:05:53.924841 [info ] [Thread-1 (]: 29 of 51 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:05:53.925451 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m07:05:53.926054 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:05:53.929574 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:05:53.931237 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:05:53.935533 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:05:53.937538 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:05:53.938042 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m07:05:53.938598 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.938598 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.939606 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:05:53.940115 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:53.945914 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:05:53.947052 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m07:05:53.948702 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m07:05:53.948702 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m07:05:53.948702 [info ] [Thread-1 (]: 29 of 51 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:05:53.950848 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:05:53.951381 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:05:53.952410 [info ] [Thread-1 (]: 30 of 51 START test unique_dim_tempo_id_data ................................... [RUN]
[0m07:05:53.952410 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m07:05:53.952410 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:05:53.955612 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:05:53.958631 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:05:53.962160 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:05:53.963166 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:05:53.963166 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m07:05:53.963166 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:53.965672 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:53.966371 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:05:53.966371 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:05:53.969047 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:53.972131 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m07:05:53.976554 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m07:05:53.977553 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m07:05:53.977553 [info ] [Thread-1 (]: 30 of 51 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.03s]
[0m07:05:53.978551 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:05:53.979552 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:05:53.980082 [info ] [Thread-1 (]: 31 of 51 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m07:05:53.981088 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m07:05:53.982257 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:05:53.991333 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:05:53.993366 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:05:54.003796 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:05:54.005364 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:05:54.006387 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m07:05:54.006387 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.007368 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.007368 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m07:05:54.007368 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.008391 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.009872 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m07:05:54.010841 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m07:05:54.010841 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m07:05:54.011862 [info ] [Thread-1 (]: 31 of 51 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.03s]
[0m07:05:54.013369 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m07:05:54.014387 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:05:54.014387 [info ] [Thread-1 (]: 32 of 51 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m07:05:54.015390 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m07:05:54.015893 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:05:54.020539 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:05:54.020539 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:05:54.024204 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:05:54.024812 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:05:54.025398 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m07:05:54.025398 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.026426 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.026426 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m07:05:54.026426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.027420 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.028951 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m07:05:54.029472 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m07:05:54.029472 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m07:05:54.030122 [info ] [Thread-1 (]: 32 of 51 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.01s]
[0m07:05:54.031126 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m07:05:54.031629 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:05:54.032131 [info ] [Thread-1 (]: 33 of 51 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:05:54.032131 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m07:05:54.033136 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:05:54.036571 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:05:54.038169 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:05:54.039747 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:05:54.039747 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:05:54.041074 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m07:05:54.042102 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.043324 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.043324 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:05:54.043324 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.050769 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m07:05:54.052478 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m07:05:54.054001 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m07:05:54.054001 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m07:05:54.054001 [info ] [Thread-1 (]: 33 of 51 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:05:54.055609 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:05:54.055609 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:05:54.056642 [info ] [Thread-1 (]: 34 of 51 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:05:54.057613 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m07:05:54.058613 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:05:54.067925 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:05:54.069449 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:05:54.074037 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:05:54.075171 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:05:54.076176 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m07:05:54.076176 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.077175 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.077175 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:05:54.078178 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.090830 [debug] [Thread-1 (]: SQL status: OK in 0.013 seconds
[0m07:05:54.093496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m07:05:54.094028 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m07:05:54.094028 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m07:05:54.095050 [info ] [Thread-1 (]: 34 of 51 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m07:05:54.095050 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:05:54.096067 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:05:54.096571 [info ] [Thread-1 (]: 35 of 51 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m07:05:54.097286 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m07:05:54.097286 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:05:54.099460 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.101138 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:05:54.103815 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.104346 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.104346 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m07:05:54.104346 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.105353 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.105353 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.105353 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m07:05:54.106378 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.107357 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.107357 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:05:54.108385 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.109373 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.109907 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:05:54.110639 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.118049 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.119578 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao" rename to "dim_classe_instituicao__dbt_backup"
[0m07:05:54.119578 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.122623 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.123146 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m07:05:54.123146 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.124871 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:05:54.124871 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.125500 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:05:54.130171 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:05:54.133969 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:05:54.134979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m07:05:54.136490 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.137490 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m07:05:54.138172 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AC1ECDA0>]}
[0m07:05:54.138919 [info ] [Thread-1 (]: 35 of 51 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.04s]
[0m07:05:54.139450 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:05:54.139450 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:05:54.139450 [info ] [Thread-1 (]: 36 of 51 START sql table model main.dim_consolidado ............................ [RUN]
[0m07:05:54.140991 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m07:05:54.140991 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m07:05:54.143548 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.143548 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m07:05:54.147547 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.149059 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.149059 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m07:05:54.149572 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.150578 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.151082 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.151082 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m07:05:54.151610 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.152639 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.152639 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:05:54.152639 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.154166 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.155858 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:05:54.155858 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.158354 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.159360 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m07:05:54.159874 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.162166 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.162671 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m07:05:54.163177 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.164877 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:05:54.165503 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.166511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:05:54.168026 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.170553 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:05:54.171057 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m07:05:54.172061 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.174583 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m07:05:54.175786 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AD7C6900>]}
[0m07:05:54.176795 [info ] [Thread-1 (]: 36 of 51 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.03s]
[0m07:05:54.177795 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:05:54.177795 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m07:05:54.179301 [info ] [Thread-1 (]: 37 of 51 START sql table model main.dim_controle ............................... [RUN]
[0m07:05:54.179967 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m07:05:54.179967 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m07:05:54.183187 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.183829 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m07:05:54.188400 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.189916 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.189916 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m07:05:54.190921 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.192439 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.192439 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.192439 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m07:05:54.193446 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.195141 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.195141 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:05:54.196179 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.197406 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.197406 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:05:54.198430 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.201811 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.201811 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m07:05:54.202824 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.205838 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.206344 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m07:05:54.207350 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.208353 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:05:54.208353 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.209348 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:05:54.210607 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.211614 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:05:54.211614 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m07:05:54.213119 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.214718 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m07:05:54.215726 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282CC30DF70>]}
[0m07:05:54.216231 [info ] [Thread-1 (]: 37 of 51 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.04s]
[0m07:05:54.216835 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m07:05:54.217841 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m07:05:54.217841 [info ] [Thread-1 (]: 38 of 51 START sql table model main.dim_segmento ............................... [RUN]
[0m07:05:54.219382 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_segmento)
[0m07:05:54.219382 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m07:05:54.222406 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.222406 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m07:05:54.225500 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.226506 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.226506 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m07:05:54.226506 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.227511 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.227511 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.227511 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m07:05:54.227511 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.229537 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.229537 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:05:54.230053 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.231595 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.231595 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:05:54.232118 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.235149 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.235149 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m07:05:54.236157 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.238321 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.238321 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m07:05:54.239834 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.240839 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:05:54.240839 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.240839 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:05:54.243393 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.246006 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:05:54.246006 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m07:05:54.247229 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.247229 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m07:05:54.248783 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AC679E80>]}
[0m07:05:54.249300 [info ] [Thread-1 (]: 38 of 51 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.03s]
[0m07:05:54.251764 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m07:05:54.252779 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:05:54.252779 [info ] [Thread-1 (]: 39 of 51 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m07:05:54.254277 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m07:05:54.255287 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:05:54.260762 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:05:54.261766 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:05:54.264281 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:05:54.266335 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:05:54.267962 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m07:05:54.267962 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.269474 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.269474 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:05:54.270480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.270984 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.271990 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m07:05:54.271990 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m07:05:54.273854 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m07:05:54.273854 [info ] [Thread-1 (]: 39 of 51 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.02s]
[0m07:05:54.274447 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:05:54.275188 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:05:54.275188 [info ] [Thread-1 (]: 40 of 51 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m07:05:54.277195 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m07:05:54.277195 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:05:54.284486 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:05:54.285538 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:05:54.287572 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:05:54.288143 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:05:54.289265 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m07:05:54.289265 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.290785 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.290785 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:05:54.290785 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.293899 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.294905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m07:05:54.296417 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m07:05:54.296956 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m07:05:54.296956 [info ] [Thread-1 (]: 40 of 51 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:05:54.296956 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:05:54.298555 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:05:54.298555 [info ] [Thread-1 (]: 41 of 51 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m07:05:54.299165 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m07:05:54.299675 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:05:54.304321 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:05:54.305326 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:05:54.307861 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:05:54.309367 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:05:54.309367 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m07:05:54.309885 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.310494 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.310494 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:05:54.310494 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:05:54.313024 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.315804 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m07:05:54.318116 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m07:05:54.319114 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m07:05:54.319624 [info ] [Thread-1 (]: 41 of 51 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m07:05:54.320634 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:05:54.320634 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:05:54.320634 [info ] [Thread-1 (]: 42 of 51 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m07:05:54.322295 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m07:05:54.322295 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:05:54.325617 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:05:54.326630 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:05:54.329694 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:05:54.330232 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:05:54.331239 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m07:05:54.331239 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.331746 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.331746 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:05:54.332768 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.333848 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.335365 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m07:05:54.336372 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m07:05:54.336372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m07:05:54.336372 [info ] [Thread-1 (]: 42 of 51 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.01s]
[0m07:05:54.337875 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:05:54.338570 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:05:54.339603 [info ] [Thread-1 (]: 43 of 51 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m07:05:54.341322 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m07:05:54.341322 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:05:54.347421 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:05:54.348437 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:05:54.353808 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:05:54.354820 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:05:54.355822 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m07:05:54.356326 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.356326 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.356326 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:05:54.357331 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.359837 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.360884 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m07:05:54.361909 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m07:05:54.361909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m07:05:54.363416 [info ] [Thread-1 (]: 43 of 51 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.02s]
[0m07:05:54.364419 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:05:54.364922 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:05:54.365429 [info ] [Thread-1 (]: 44 of 51 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m07:05:54.366941 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m07:05:54.367455 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:05:54.372080 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:05:54.373593 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:05:54.375105 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:05:54.376113 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:05:54.377110 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m07:05:54.377110 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.378605 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.379117 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:05:54.379644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:05:54.383112 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:05:54.386064 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m07:05:54.386064 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m07:05:54.386064 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m07:05:54.387595 [info ] [Thread-1 (]: 44 of 51 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m07:05:54.388241 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:05:54.388241 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:05:54.388241 [info ] [Thread-1 (]: 45 of 51 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m07:05:54.389842 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m07:05:54.389842 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:05:54.395104 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:05:54.396624 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:05:54.397311 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:05:54.399498 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:05:54.399498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m07:05:54.401016 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.401679 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.401679 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:05:54.401679 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.402700 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.404187 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m07:05:54.404187 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m07:05:54.405697 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m07:05:54.406707 [info ] [Thread-1 (]: 45 of 51 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.02s]
[0m07:05:54.406707 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:05:54.407706 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:05:54.407706 [info ] [Thread-1 (]: 46 of 51 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m07:05:54.407706 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m07:05:54.409212 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:05:54.413997 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:05:54.414506 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:05:54.417237 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:05:54.419582 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:05:54.420587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m07:05:54.420587 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.420587 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.420587 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:05:54.420587 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.424609 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.425634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m07:05:54.426173 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m07:05:54.427185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m07:05:54.427185 [info ] [Thread-1 (]: 46 of 51 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.02s]
[0m07:05:54.428176 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:05:54.428176 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:05:54.429168 [info ] [Thread-1 (]: 47 of 51 START test unique_dim_controle_id_controle ............................ [RUN]
[0m07:05:54.429676 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m07:05:54.429676 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:05:54.436650 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:05:54.438152 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:05:54.440803 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:05:54.442397 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:05:54.443403 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m07:05:54.443403 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.443403 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.443403 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:05:54.443403 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:05:54.446066 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.447269 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m07:05:54.449932 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m07:05:54.451590 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m07:05:54.452601 [info ] [Thread-1 (]: 47 of 51 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.02s]
[0m07:05:54.454105 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:05:54.454105 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:05:54.454105 [info ] [Thread-1 (]: 48 of 51 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m07:05:54.455704 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m07:05:54.455704 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:05:54.461501 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:05:54.462504 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:05:54.464622 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:05:54.467659 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:05:54.468670 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m07:05:54.469208 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.470725 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.470725 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:05:54.472384 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.472384 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.473899 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m07:05:54.474992 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m07:05:54.475586 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m07:05:54.475586 [info ] [Thread-1 (]: 48 of 51 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.02s]
[0m07:05:54.476616 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:05:54.477605 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:05:54.480125 [info ] [Thread-1 (]: 49 of 51 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m07:05:54.482014 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m07:05:54.483535 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:05:54.493659 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:05:54.494840 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:05:54.499505 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:05:54.503833 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:05:54.503833 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m07:05:54.506486 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.506486 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.507480 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:05:54.507480 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:05:54.509479 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.510603 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m07:05:54.511607 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m07:05:54.511607 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m07:05:54.511607 [info ] [Thread-1 (]: 49 of 51 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.03s]
[0m07:05:54.513228 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:05:54.513228 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:05:54.514971 [info ] [Thread-1 (]: 50 of 51 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m07:05:54.515677 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m07:05:54.516299 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:05:54.519471 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:05:54.521016 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:05:54.522051 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:05:54.523656 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:05:54.523656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m07:05:54.523656 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.524661 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:05:54.524661 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:05:54.525689 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:05:54.530020 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:05:54.532176 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m07:05:54.533805 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m07:05:54.533805 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m07:05:54.534809 [info ] [Thread-1 (]: 50 of 51 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.02s]
[0m07:05:54.535398 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:05:54.537422 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m07:05:54.538852 [info ] [Thread-1 (]: 51 of 51 START sql view model main.view_balanco_patrimonial_relatorios ......... [RUN]
[0m07:05:54.540398 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios)
[0m07:05:54.541938 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m07:05:54.549841 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:05:54.551444 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m07:05:54.567113 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:05:54.568625 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:05:54.569139 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: BEGIN
[0m07:05:54.569139 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:05:54.570752 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.570752 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:05:54.570752 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */

  
  create view "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_balanco_patrimonial"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
),
dim_classe AS (
    SELECT * FROM "gold_warehouse"."main"."dim_classe_instituicao"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    cl.descricao as classe_instituicao,
    
    -- Data
    t.data as data_base,
    
    -- Fatos Ativo
    f.disponibilidades,
    f.aplicacoes_interfinanceiras_liquidez,
    f.tvm_derivativos,
    f.operacoes_de_credito,
    f.provisao_operacoes_de_credito,
    f.operacoes_de_credito_liquidas_provisao,
    f.arrendamento_mercantil_a_receber,
    f.imobilizado_de_arrendamento,
    f.credores_antecipacao_valor_residual,
    f.provisao_arrendamento_mercantil,
    f.arrendamento_mercantil_liquido_de_provisao,
    f.outros_creditos_liquido_de_provisao,
    f.outros_ativos_realizaveis,
    f.permanente_ajustado,
    f.ativo_total_ajustado,
    f.ativo_total,
    
    -- Fatos Passivo
    f.depositos_vista,
    f.depositos_poupanca,
    f.depositos_interfinanceiros,
    f.depositos_a_prazo,
    f.conta_de_pagamento_pre_paga,
    f.depositos_outros,
    f.depositos,
    f.captacoes_mercado_aberto,
    f.letras_de_credito_imobiliario,
    f.letras_de_credito_agronegocio,
    f.letras_financeiras,
    f.obrigacoes_titulos_e_valores_mobiliarios_exterior,
    f.outros_recursos_de_aceites_e_emissao_de_titulos,
    f.recursos_aceites_cambiais,
    f.obrigacoes_emprestimos_repasses,
    f.captacoes,
    f.obrigacoes_por_instr_financeiros_derivativos,
    f.outras_obrigacoes,
    f.passivo_circulante_exigivel_longo_prazo,
    f.patrimonio_liquido,
    f.passivo_total

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
LEFT JOIN dim_classe cl ON i.id_classe = cl.id_classe
  );

[0m07:05:54.573410 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:05:54.576403 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:05:54.576403 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */
alter view "gold_warehouse"."main"."view_balanco_patrimonial_relatorios" rename to "view_balanco_patrimonial_relatorios__dbt_backup"
[0m07:05:54.577404 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.583166 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:05:54.583496 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */
alter view "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_tmp" rename to "view_balanco_patrimonial_relatorios"
[0m07:05:54.584000 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.585021 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: COMMIT
[0m07:05:54.585545 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:05:54.585545 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: COMMIT
[0m07:05:54.589247 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:05:54.591253 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m07:05:54.591759 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_backup" cascade
    
[0m07:05:54.592269 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:05:54.593294 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: Close
[0m07:05:54.594940 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ebe0c4b9-bd1e-4b8d-9d2d-375a02539265', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282CC2FF350>]}
[0m07:05:54.594940 [info ] [Thread-1 (]: 51 of 51 OK created sql view model main.view_balanco_patrimonial_relatorios .... [[32mOK[0m in 0.05s]
[0m07:05:54.596761 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m07:05:54.597557 [debug] [MainThread]: Using duckdb connection "master"
[0m07:05:54.598561 [debug] [MainThread]: On master: BEGIN
[0m07:05:54.599063 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m07:05:54.599572 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m07:05:54.599572 [debug] [MainThread]: On master: COMMIT
[0m07:05:54.599572 [debug] [MainThread]: Using duckdb connection "master"
[0m07:05:54.599572 [debug] [MainThread]: On master: COMMIT
[0m07:05:54.599572 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:05:54.601294 [debug] [MainThread]: On master: Close
[0m07:05:54.601294 [debug] [MainThread]: Connection 'master' was properly closed.
[0m07:05:54.601294 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m07:05:54.601294 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m07:05:54.602031 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios' was properly closed.
[0m07:05:54.602031 [info ] [MainThread]: 
[0m07:05:54.602031 [info ] [MainThread]: Finished running 4 seeds, 8 table models, 38 data tests, 1 view model in 0 hours 0 minutes and 3.54 seconds (3.54s).
[0m07:05:54.606631 [debug] [MainThread]: Command end result
[0m07:05:54.704075 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:05:54.706718 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:05:54.712112 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m07:05:54.712112 [info ] [MainThread]: 
[0m07:05:54.713618 [info ] [MainThread]: [32mCompleted successfully[0m
[0m07:05:54.713618 [info ] [MainThread]: 
[0m07:05:54.714621 [info ] [MainThread]: Done. PASS=51 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=51
[0m07:05:54.715626 [debug] [MainThread]: Command `dbt build` succeeded at 07:05:54.715124 after 4.67 seconds
[0m07:05:54.715626 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AA1A2360>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AA16AD80>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000282AA16A390>]}
[0m07:05:54.715626 [debug] [MainThread]: Flushing usage events
[0m07:05:55.619451 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m07:21:11.975657 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D6EB30B0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D47C1EE0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D79DF920>]}


============================== 07:21:11.979792 | ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0 ==============================
[0m07:21:11.979792 [info ] [MainThread]: Running with dbt=1.11.5
[0m07:21:11.981546 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'target_path': 'None', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'fail_fast': 'False', 'debug': 'False', 'log_format': 'default', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'partial_parse': 'True', 'use_colors': 'True', 'invocation_command': 'dbt build --select +view_dre_relatorios', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m07:21:12.165390 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D6F17D10>]}
[0m07:21:12.214379 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D8E33F50>]}
[0m07:21:12.216692 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m07:21:12.475178 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m07:21:12.605619 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 1 files added, 2 files changed.
[0m07:21:12.605619 [debug] [MainThread]: Partial parsing: added file: bacen_ifdata_analytics://models\gold\view_dre_relatorios.sql
[0m07:21:12.607163 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\schema.yml
[0m07:21:12.607163 [debug] [MainThread]: Partial parsing: updated file: bacen_ifdata_analytics://models\gold\fato_demonstracao_resultado.sql
[0m07:21:12.933077 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on
'fato_demonstracao_resultado' in package 'bacen_ifdata_analytics'
(models\gold\schema.yml). Arguments to generic tests should be nested under the
`arguments` property.
[0m07:21:12.934449 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D986A900>]}
[0m07:21:13.014689 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m07:21:13.026208 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D96B0830>]}
[0m07:21:13.108310 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:21:13.110473 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:21:13.159924 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D9653F80>]}
[0m07:21:13.160596 [info ] [MainThread]: Found 29 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m07:21:13.165747 [info ] [MainThread]: 
[0m07:21:13.166249 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m07:21:13.166783 [info ] [MainThread]: 
[0m07:21:13.167370 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m07:21:13.172277 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m07:21:13.250672 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m07:21:13.250672 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m07:21:13.251434 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:21:13.392816 [debug] [ThreadPool]: SQL status: OK in 0.141 seconds
[0m07:21:13.393568 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m07:21:13.394575 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m07:21:13.394575 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m07:21:13.398979 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:21:13.399486 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m07:21:13.399486 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m07:21:13.400586 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m07:21:13.401797 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:21:13.401797 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m07:21:13.401797 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:21:13.402802 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:21:13.402802 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m07:21:13.402802 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:21:13.403817 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:21:13.403817 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m07:21:13.404353 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m07:21:13.404353 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:21:13.404353 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m07:21:13.406506 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m07:21:13.411549 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:21:13.411549 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m07:21:13.411549 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m07:21:13.411549 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m07:21:13.411549 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m07:21:13.413054 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m07:21:13.424982 [debug] [ThreadPool]: SQL status: OK in 0.012 seconds
[0m07:21:13.425566 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m07:21:13.427571 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m07:21:13.427571 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m07:21:13.432071 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D96A3E60>]}
[0m07:21:13.432587 [debug] [MainThread]: Using duckdb connection "master"
[0m07:21:13.432587 [debug] [MainThread]: On master: BEGIN
[0m07:21:13.432587 [debug] [MainThread]: Opening a new connection, currently in state init
[0m07:21:13.433093 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:21:13.433093 [debug] [MainThread]: On master: COMMIT
[0m07:21:13.433745 [debug] [MainThread]: Using duckdb connection "master"
[0m07:21:13.433745 [debug] [MainThread]: On master: COMMIT
[0m07:21:13.434461 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:21:13.434461 [debug] [MainThread]: On master: Close
[0m07:21:13.438675 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:21:13.439679 [info ] [Thread-1 (]: 1 of 51 START sql table model main.dim_instituicao ............................. [RUN]
[0m07:21:13.439679 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m07:21:13.439679 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m07:21:13.456257 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:13.457262 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m07:21:13.483175 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:13.484687 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:13.484687 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m07:21:13.485296 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m07:21:13.485296 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:13.485296 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:13.486797 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m07:21:13.972216 [debug] [Thread-1 (]: SQL status: OK in 0.484 seconds
[0m07:21:13.977164 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:13.977164 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:21:13.978177 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:13.979698 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:13.979698 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m07:21:13.979698 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:13.985267 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:13.986280 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m07:21:13.987805 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:13.991864 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:13.991864 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m07:21:13.994189 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:14.009530 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:21:14.010075 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:14.010662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m07:21:14.028286 [debug] [Thread-1 (]: SQL status: OK in 0.017 seconds
[0m07:21:14.037667 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m07:21:14.038232 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m07:21:14.039765 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:14.044685 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m07:21:14.048898 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190DADFF590>]}
[0m07:21:14.051508 [info ] [Thread-1 (]: 1 of 51 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.61s]
[0m07:21:14.052515 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m07:21:14.052515 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:21:14.052515 [info ] [Thread-1 (]: 2 of 51 START sql table model main.dim_localizacao ............................. [RUN]
[0m07:21:14.054019 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m07:21:14.054019 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m07:21:14.059662 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.060833 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m07:21:14.064353 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.065708 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.066363 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m07:21:14.066910 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:14.067945 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:14.068923 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.068923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m07:21:14.144771 [debug] [Thread-1 (]: SQL status: OK in 0.076 seconds
[0m07:21:14.146434 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.146434 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:21:14.147157 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.148275 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.148275 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m07:21:14.148889 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.151688 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.152697 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m07:21:14.152697 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.155267 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.155801 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m07:21:14.155801 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.156813 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:21:14.156813 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.157812 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m07:21:14.159896 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:14.162032 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m07:21:14.162032 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m07:21:14.163044 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:14.163044 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m07:21:14.163044 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190DAE12330>]}
[0m07:21:14.164778 [info ] [Thread-1 (]: 2 of 51 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.11s]
[0m07:21:14.165369 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m07:21:14.165369 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m07:21:14.166375 [info ] [Thread-1 (]: 3 of 51 START sql table model main.dim_tempo ................................... [RUN]
[0m07:21:14.166893 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m07:21:14.167927 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m07:21:14.175563 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.176582 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m07:21:14.179574 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.181380 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.182116 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m07:21:14.182116 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:14.182116 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:14.183122 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.183627 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m07:21:14.253831 [debug] [Thread-1 (]: SQL status: OK in 0.069 seconds
[0m07:21:14.254336 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.254336 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:21:14.255848 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.256352 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.257358 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m07:21:14.257358 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.259864 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.260870 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m07:21:14.261375 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.263381 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.263381 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m07:21:14.263887 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.264392 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:21:14.265397 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.265397 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m07:21:14.267400 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:14.269201 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m07:21:14.269718 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m07:21:14.270860 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:14.271881 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m07:21:14.271881 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D9D9B5C0>]}
[0m07:21:14.271881 [info ] [Thread-1 (]: 3 of 51 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.10s]
[0m07:21:14.273468 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m07:21:14.273468 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:21:14.274471 [info ] [Thread-1 (]: 4 of 51 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m07:21:14.274974 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m07:21:14.274974 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:21:14.279114 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.280131 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:21:14.284472 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.285784 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.285784 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m07:21:14.285784 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:14.287446 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:14.287446 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.288050 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio as resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_proprio as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    resultado_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital,
    roe,
    roa
FROM dre
    );
  
  
[0m07:21:14.903901 [debug] [Thread-1 (]: SQL status: OK in 0.615 seconds
[0m07:21:14.903901 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.905457 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_demonstracao_resultado'
  
[0m07:21:14.905457 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.906469 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.907468 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_demonstracao_resultado'
  
[0m07:21:14.907468 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.910009 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.910729 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado" rename to "fato_demonstracao_resultado__dbt_backup"
[0m07:21:14.910729 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.913257 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.913257 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m07:21:14.914261 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:14.915294 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:21:14.915294 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:14.915867 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m07:21:15.093902 [debug] [Thread-1 (]: SQL status: OK in 0.178 seconds
[0m07:21:15.096895 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m07:21:15.096895 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m07:21:15.098908 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:15.100182 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m07:21:15.100847 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190DAD78050>]}
[0m07:21:15.101441 [info ] [Thread-1 (]: 4 of 51 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.83s]
[0m07:21:15.101957 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m07:21:15.101957 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:21:15.102989 [info ] [Thread-1 (]: 5 of 51 START seed file main.seed_dim_classe_instituicao ....................... [RUN]
[0m07:21:15.103979 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m07:21:15.104512 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:21:15.104512 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:21:15.124542 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:21:15.125119 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m07:21:15.125119 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.126125 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.126125 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:21:15.127134 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */
truncate table "gold_warehouse"."main"."seed_dim_classe_instituicao"
[0m07:21:15.127134 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.142309 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:21:15.142814 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:21:15.146413 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:21:15.151065 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:21:15.152756 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:21:15.152756 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m07:21:15.152756 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m07:21:15.155753 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.157034 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m07:21:15.157034 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190DADCFAD0>]}
[0m07:21:15.157034 [info ] [Thread-1 (]: 5 of 51 OK loaded seed file main.seed_dim_classe_instituicao ................... [[32mINSERT 32[0m in 0.05s]
[0m07:21:15.158033 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m07:21:15.158033 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:21:15.159536 [info ] [Thread-1 (]: 6 of 51 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m07:21:15.160049 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m07:21:15.160049 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:21:15.160049 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:21:15.165635 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:21:15.166154 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m07:21:15.166154 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.166154 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.167183 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:21:15.167183 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m07:21:15.167717 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.167717 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:21:15.167717 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:21:15.171295 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:15.172302 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:21:15.174897 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:21:15.174897 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m07:21:15.174897 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m07:21:15.177914 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:15.177914 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m07:21:15.179421 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190DADC4740>]}
[0m07:21:15.180061 [info ] [Thread-1 (]: 6 of 51 OK loaded seed file main.seed_dim_consolidado .......................... [[32mINSERT 8[0m in 0.02s]
[0m07:21:15.181069 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m07:21:15.181069 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:21:15.182409 [info ] [Thread-1 (]: 7 of 51 START seed file main.seed_dim_controle ................................. [RUN]
[0m07:21:15.183034 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m07:21:15.183667 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:21:15.183667 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:21:15.189752 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:21:15.191370 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m07:21:15.191370 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.191370 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.192393 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:21:15.192393 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m07:21:15.192393 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.193535 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:21:15.193535 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:21:15.196138 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.196640 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:21:15.198730 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:21:15.199363 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m07:21:15.199363 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m07:21:15.202917 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:21:15.203940 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m07:21:15.204477 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190DADC56D0>]}
[0m07:21:15.204477 [info ] [Thread-1 (]: 7 of 51 OK loaded seed file main.seed_dim_controle ............................. [[32mINSERT 3[0m in 0.02s]
[0m07:21:15.205985 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m07:21:15.207532 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:21:15.208537 [info ] [Thread-1 (]: 8 of 51 START seed file main.seed_dim_segmento ................................. [RUN]
[0m07:21:15.210041 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m07:21:15.210556 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:21:15.210556 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:21:15.215650 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:21:15.215650 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m07:21:15.217054 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.217054 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.217054 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:21:15.218060 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m07:21:15.218563 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.219577 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:21:15.219577 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m07:21:15.221085 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.222088 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:21:15.223095 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:21:15.224994 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m07:21:15.225658 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m07:21:15.226696 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.226696 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m07:21:15.228228 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190DADF1A60>]}
[0m07:21:15.228228 [info ] [Thread-1 (]: 8 of 51 OK loaded seed file main.seed_dim_segmento ............................. [[32mINSERT 5[0m in 0.02s]
[0m07:21:15.229244 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m07:21:15.229748 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:21:15.230752 [info ] [Thread-1 (]: 9 of 51 START test not_null_dim_instituicao_id_instituicao ..................... [RUN]
[0m07:21:15.230752 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m07:21:15.231964 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:21:15.238461 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:21:15.239465 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:21:15.254074 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:21:15.254577 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:21:15.255580 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m07:21:15.255580 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.255580 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.256920 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m07:21:15.256920 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.257953 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.261043 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m07:21:15.263061 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m07:21:15.263061 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m07:21:15.264074 [info ] [Thread-1 (]: 9 of 51 PASS not_null_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m07:21:15.264577 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m07:21:15.264577 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:21:15.265770 [info ] [Thread-1 (]: 10 of 51 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m07:21:15.266374 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m07:21:15.267000 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:21:15.272185 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:21:15.273223 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:21:15.275678 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:21:15.276683 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:21:15.276683 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m07:21:15.276683 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.277682 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.277682 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m07:21:15.277682 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.279719 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.281312 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m07:21:15.284544 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m07:21:15.284544 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m07:21:15.286059 [info ] [Thread-1 (]: 10 of 51 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m07:21:15.287564 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m07:21:15.288084 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:21:15.288687 [info ] [Thread-1 (]: 11 of 51 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:21:15.289692 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m07:21:15.289692 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:21:15.298243 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:21:15.299752 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:21:15.301411 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:21:15.302415 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:21:15.302415 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m07:21:15.302415 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.303950 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.303950 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m07:21:15.303950 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.313144 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m07:21:15.314150 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m07:21:15.316082 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m07:21:15.316082 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m07:21:15.316082 [info ] [Thread-1 (]: 11 of 51 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:21:15.317106 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m07:21:15.317639 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:21:15.317639 [info ] [Thread-1 (]: 12 of 51 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:21:15.318648 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m07:21:15.318648 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:21:15.322432 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:21:15.323439 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:21:15.325500 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:21:15.326505 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:21:15.326505 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m07:21:15.327510 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.329034 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.330083 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m07:21:15.331109 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.338520 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:21:15.340063 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m07:21:15.341073 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m07:21:15.342079 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m07:21:15.342609 [info ] [Thread-1 (]: 12 of 51 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:21:15.343132 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m07:21:15.343132 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:21:15.343132 [info ] [Thread-1 (]: 13 of 51 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:21:15.343132 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m07:21:15.345219 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:21:15.348971 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:21:15.349516 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:21:15.353603 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:21:15.354659 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:21:15.354659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m07:21:15.355690 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.355690 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.355690 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m07:21:15.357151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.360992 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:21:15.362025 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m07:21:15.363227 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m07:21:15.363227 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m07:21:15.363227 [info ] [Thread-1 (]: 13 of 51 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:21:15.364917 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m07:21:15.365605 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:21:15.366115 [info ] [Thread-1 (]: 14 of 51 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:21:15.366115 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m07:21:15.367119 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:21:15.370714 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:21:15.372283 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:21:15.375005 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:21:15.376186 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:21:15.377189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m07:21:15.377189 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.378191 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.378191 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m07:21:15.378191 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.383952 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m07:21:15.385563 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m07:21:15.385563 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m07:21:15.386723 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m07:21:15.386723 [info ] [Thread-1 (]: 14 of 51 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:21:15.388251 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m07:21:15.388251 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:21:15.388251 [info ] [Thread-1 (]: 15 of 51 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:21:15.389764 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m07:21:15.389764 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:21:15.395136 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:21:15.396806 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:21:15.402359 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:21:15.403884 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:21:15.403884 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m07:21:15.405482 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.405482 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.406488 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m07:21:15.406488 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.411668 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:21:15.415310 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m07:21:15.416516 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m07:21:15.416516 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m07:21:15.417107 [info ] [Thread-1 (]: 15 of 51 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:21:15.418115 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m07:21:15.419112 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:21:15.419619 [info ] [Thread-1 (]: 16 of 51 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:21:15.422158 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m07:21:15.423196 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:21:15.429874 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:21:15.431893 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:21:15.438046 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:21:15.439714 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:21:15.440750 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m07:21:15.440750 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.440750 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.442319 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m07:21:15.442319 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.446687 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:21:15.447281 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m07:21:15.448839 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m07:21:15.449439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m07:21:15.449439 [info ] [Thread-1 (]: 16 of 51 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:21:15.451116 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m07:21:15.451704 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:21:15.451704 [info ] [Thread-1 (]: 17 of 51 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:21:15.452709 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m07:21:15.452709 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:21:15.457418 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:21:15.457418 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:21:15.459946 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:21:15.460614 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:21:15.461618 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m07:21:15.461618 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.463123 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.463123 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m07:21:15.463123 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.479651 [debug] [Thread-1 (]: SQL status: OK in 0.014 seconds
[0m07:21:15.481426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m07:21:15.483274 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m07:21:15.483274 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m07:21:15.484612 [info ] [Thread-1 (]: 17 of 51 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m07:21:15.486637 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m07:21:15.487649 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:21:15.488171 [info ] [Thread-1 (]: 18 of 51 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m07:21:15.489508 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m07:21:15.489508 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:21:15.496173 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:21:15.497016 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:21:15.502520 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:21:15.502520 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:21:15.504059 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m07:21:15.504059 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.504059 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.505808 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m07:21:15.505808 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:21:15.508325 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:21:15.511102 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m07:21:15.512135 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m07:21:15.513125 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m07:21:15.513635 [info ] [Thread-1 (]: 18 of 51 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m07:21:15.514641 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m07:21:15.514641 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:21:15.516175 [info ] [Thread-1 (]: 19 of 51 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m07:21:15.516696 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m07:21:15.516696 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:21:15.522309 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:21:15.523477 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:21:15.525170 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:21:15.526195 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:21:15.526195 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m07:21:15.527222 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.527222 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.527222 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m07:21:15.527222 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.529286 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.529813 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m07:21:15.531486 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m07:21:15.531486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m07:21:15.532117 [info ] [Thread-1 (]: 19 of 51 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m07:21:15.533123 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m07:21:15.533625 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:21:15.534205 [info ] [Thread-1 (]: 20 of 51 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m07:21:15.534739 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m07:21:15.535336 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:21:15.543380 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:21:15.543380 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:21:15.546684 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:21:15.548502 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:21:15.549007 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m07:21:15.549525 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.549525 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.549525 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m07:21:15.551209 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.552928 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:15.555006 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m07:21:15.555555 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m07:21:15.555555 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m07:21:15.555555 [info ] [Thread-1 (]: 20 of 51 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m07:21:15.556583 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m07:21:15.557567 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:21:15.557567 [info ] [Thread-1 (]: 21 of 51 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m07:21:15.558567 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m07:21:15.558567 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:21:15.563864 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:21:15.564467 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:21:15.567484 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:21:15.568989 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:21:15.569507 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m07:21:15.569507 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.569507 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.570531 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m07:21:15.570531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:21:15.572040 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.573716 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m07:21:15.574729 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m07:21:15.574729 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m07:21:15.575250 [info ] [Thread-1 (]: 21 of 51 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m07:21:15.576283 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m07:21:15.576283 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:21:15.577424 [info ] [Thread-1 (]: 22 of 51 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m07:21:15.578452 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m07:21:15.579441 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:21:15.585395 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:21:15.587400 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:21:15.590043 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:21:15.591049 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:21:15.592070 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m07:21:15.592070 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.592578 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.592578 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m07:21:15.593585 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.593585 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.595304 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m07:21:15.596836 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m07:21:15.596836 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m07:21:15.597476 [info ] [Thread-1 (]: 22 of 51 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.02s]
[0m07:21:15.598488 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m07:21:15.598991 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:21:15.599499 [info ] [Thread-1 (]: 23 of 51 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:21:15.599499 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m07:21:15.600502 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:21:15.605388 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:21:15.606811 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:21:15.608816 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:21:15.611011 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:21:15.612018 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m07:21:15.612548 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.613071 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.613071 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m07:21:15.613071 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.621377 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m07:21:15.623460 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m07:21:15.624490 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m07:21:15.624490 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m07:21:15.625301 [info ] [Thread-1 (]: 23 of 51 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:21:15.626314 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m07:21:15.626314 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:21:15.627315 [info ] [Thread-1 (]: 24 of 51 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:21:15.627315 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m07:21:15.628330 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:21:15.633721 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:21:15.635132 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:21:15.640934 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:21:15.644180 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:21:15.644716 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m07:21:15.644716 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.647099 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.647099 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m07:21:15.647099 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.651933 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m07:21:15.655551 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m07:21:15.657574 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m07:21:15.658555 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m07:21:15.659576 [info ] [Thread-1 (]: 24 of 51 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:21:15.660754 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m07:21:15.660754 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:21:15.661257 [info ] [Thread-1 (]: 25 of 51 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:21:15.662283 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m07:21:15.663263 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:21:15.673995 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:21:15.675899 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:21:15.682176 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:21:15.684984 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:21:15.686623 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m07:21:15.686623 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.688151 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.688151 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m07:21:15.688151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.691015 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:15.693530 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m07:21:15.695104 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m07:21:15.695104 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m07:21:15.696134 [info ] [Thread-1 (]: 25 of 51 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m07:21:15.696658 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m07:21:15.697411 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:21:15.697411 [info ] [Thread-1 (]: 26 of 51 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:21:15.697411 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m07:21:15.697411 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:21:15.704821 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:21:15.705475 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:21:15.708049 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:21:15.708049 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:21:15.709571 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m07:21:15.709571 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.709571 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.709571 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m07:21:15.711591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.714756 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:21:15.716662 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m07:21:15.717684 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m07:21:15.717684 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m07:21:15.718666 [info ] [Thread-1 (]: 26 of 51 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:21:15.718666 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m07:21:15.719574 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:21:15.719574 [info ] [Thread-1 (]: 27 of 51 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:21:15.719574 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m07:21:15.719574 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:21:15.724659 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:21:15.725671 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:21:15.729182 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:21:15.729702 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:21:15.729702 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m07:21:15.731965 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.731965 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.733489 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m07:21:15.733489 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.736309 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:15.737859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m07:21:15.738468 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m07:21:15.739489 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m07:21:15.739489 [info ] [Thread-1 (]: 27 of 51 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:21:15.739489 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m07:21:15.741073 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:21:15.741073 [info ] [Thread-1 (]: 28 of 51 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:21:15.741607 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m07:21:15.742150 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:21:15.745398 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:21:15.746931 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:21:15.749452 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:21:15.751724 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:21:15.752728 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m07:21:15.752728 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.753729 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.754259 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m07:21:15.754259 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.757467 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:21:15.758518 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m07:21:15.760025 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m07:21:15.760025 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m07:21:15.760741 [info ] [Thread-1 (]: 28 of 51 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:21:15.761747 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m07:21:15.761747 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:21:15.761747 [info ] [Thread-1 (]: 29 of 51 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:21:15.763251 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m07:21:15.763251 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:21:15.769619 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:21:15.770633 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:21:15.829642 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:21:15.831207 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:21:15.831711 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m07:21:15.832214 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.832214 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.833218 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m07:21:15.833721 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.836425 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:21:15.838268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m07:21:15.838786 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m07:21:15.838786 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m07:21:15.839813 [info ] [Thread-1 (]: 29 of 51 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.08s]
[0m07:21:15.841089 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m07:21:15.841089 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:21:15.841089 [info ] [Thread-1 (]: 30 of 51 START test unique_dim_tempo_id_data ................................... [RUN]
[0m07:21:15.842111 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m07:21:15.842111 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:21:15.844890 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:21:15.845969 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:21:15.847494 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:21:15.848996 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:21:15.848996 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m07:21:15.849506 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.849506 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.849506 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m07:21:15.850509 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:21:15.852526 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:15.852526 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m07:21:15.854048 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m07:21:15.854048 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m07:21:15.854048 [info ] [Thread-1 (]: 30 of 51 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m07:21:15.855582 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m07:21:15.855582 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:21:15.855582 [info ] [Thread-1 (]: 31 of 51 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m07:21:15.856585 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m07:21:15.856585 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:21:15.860264 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:21:15.860987 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:21:15.863695 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:21:15.867457 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:21:15.867457 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m07:21:15.867457 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.868968 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.869481 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m07:21:15.869481 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.869481 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.870998 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m07:21:15.872237 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m07:21:15.872237 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m07:21:15.873749 [info ] [Thread-1 (]: 31 of 51 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.02s]
[0m07:21:15.874900 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m07:21:15.874900 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:21:15.875483 [info ] [Thread-1 (]: 32 of 51 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m07:21:15.876488 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m07:21:15.876488 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:21:15.880052 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:21:15.883119 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:21:15.886390 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:21:15.886390 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:21:15.888248 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m07:21:15.888754 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.888754 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.889787 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m07:21:15.889787 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.890824 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.890824 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m07:21:15.892492 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m07:21:15.893064 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m07:21:15.893603 [info ] [Thread-1 (]: 32 of 51 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m07:21:15.894610 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m07:21:15.894610 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:21:15.894610 [info ] [Thread-1 (]: 33 of 51 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m07:21:15.894610 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m07:21:15.894610 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:21:15.900334 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:21:15.901452 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:21:15.903984 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:21:15.906591 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:21:15.907595 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m07:21:15.907595 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.908589 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.909124 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m07:21:15.909651 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.912944 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:21:15.915566 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m07:21:15.916616 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m07:21:15.916616 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m07:21:15.917644 [info ] [Thread-1 (]: 33 of 51 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m07:21:15.917644 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m07:21:15.919151 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:21:15.919710 [info ] [Thread-1 (]: 34 of 51 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m07:21:15.920718 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m07:21:15.921224 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:21:15.926653 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:21:15.927648 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:21:15.932704 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:21:15.933797 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:21:15.935313 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m07:21:15.936324 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.937853 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.938592 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m07:21:15.938592 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:15.951554 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m07:21:15.954091 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m07:21:15.956242 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m07:21:15.956242 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m07:21:15.957248 [info ] [Thread-1 (]: 34 of 51 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m07:21:15.958251 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m07:21:15.958251 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:21:15.959780 [info ] [Thread-1 (]: 35 of 51 START sql table model main.dim_classe_instituicao ..................... [RUN]
[0m07:21:15.961087 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m07:21:15.961087 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:21:15.965683 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.966701 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:21:15.971250 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.972257 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.973263 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m07:21:15.973263 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:15.974388 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.975006 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.975006 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m07:21:15.976192 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.977201 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.977705 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:21:15.977705 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.979935 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.979935 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_classe_instituicao'
  
[0m07:21:15.980955 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.987397 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.987903 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao" rename to "dim_classe_instituicao__dbt_backup"
[0m07:21:15.987903 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.990150 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.990150 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m07:21:15.991155 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:15.992668 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:21:15.992668 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.993172 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m07:21:15.994811 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:15.997005 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m07:21:15.997524 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m07:21:15.999158 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.001009 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m07:21:16.001562 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190F98F6930>]}
[0m07:21:16.001562 [info ] [Thread-1 (]: 35 of 51 OK created sql table model main.dim_classe_instituicao ................ [[32mOK[0m in 0.04s]
[0m07:21:16.002624 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m07:21:16.002624 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:21:16.003567 [info ] [Thread-1 (]: 36 of 51 START sql table model main.dim_consolidado ............................ [RUN]
[0m07:21:16.005013 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m07:21:16.005013 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m07:21:16.008804 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.010310 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m07:21:16.018658 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.020722 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.021226 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m07:21:16.021226 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.022236 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.022774 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.023310 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m07:21:16.024823 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.026610 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.027604 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:21:16.029111 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.029640 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.029640 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_consolidado'
  
[0m07:21:16.031955 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.035483 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.036490 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado" rename to "dim_consolidado__dbt_backup"
[0m07:21:16.037994 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.040262 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.041266 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m07:21:16.041266 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.043285 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:21:16.043285 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.043285 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m07:21:16.044905 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.047147 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m07:21:16.048152 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m07:21:16.048657 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.050231 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m07:21:16.050746 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D98F9910>]}
[0m07:21:16.051432 [info ] [Thread-1 (]: 36 of 51 OK created sql table model main.dim_consolidado ....................... [[32mOK[0m in 0.05s]
[0m07:21:16.052453 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m07:21:16.052453 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m07:21:16.053959 [info ] [Thread-1 (]: 37 of 51 START sql table model main.dim_controle ............................... [RUN]
[0m07:21:16.053959 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m07:21:16.053959 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m07:21:16.056913 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.058035 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m07:21:16.061984 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.063627 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.063627 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m07:21:16.064634 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.065750 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.066395 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.067045 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m07:21:16.069089 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.071183 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.071183 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:21:16.073361 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.074562 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.074562 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_controle'
  
[0m07:21:16.075172 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.077179 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.077179 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle" rename to "dim_controle__dbt_backup"
[0m07:21:16.078685 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.081234 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.081747 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m07:21:16.081747 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.083998 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:21:16.084661 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.084661 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m07:21:16.085882 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.088394 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m07:21:16.088394 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m07:21:16.089908 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.090915 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m07:21:16.090915 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190F98F48F0>]}
[0m07:21:16.092330 [info ] [Thread-1 (]: 37 of 51 OK created sql table model main.dim_controle .......................... [[32mOK[0m in 0.04s]
[0m07:21:16.093840 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m07:21:16.094846 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m07:21:16.094846 [info ] [Thread-1 (]: 38 of 51 START sql table model main.dim_segmento ............................... [RUN]
[0m07:21:16.096474 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_segmento)
[0m07:21:16.097125 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m07:21:16.099891 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.100913 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m07:21:16.106101 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.108108 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.108108 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m07:21:16.108108 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.108108 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.109617 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.110147 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m07:21:16.110666 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.113176 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.113176 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:21:16.114196 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.116729 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.117739 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_segmento'
  
[0m07:21:16.120824 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.123023 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.123023 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento" rename to "dim_segmento__dbt_backup"
[0m07:21:16.124599 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.126154 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.127160 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m07:21:16.128159 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.129668 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:21:16.129668 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.129668 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m07:21:16.131231 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.133835 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m07:21:16.133835 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m07:21:16.135346 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.137411 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m07:21:16.137928 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190DADD5C70>]}
[0m07:21:16.138681 [info ] [Thread-1 (]: 38 of 51 OK created sql table model main.dim_segmento .......................... [[32mOK[0m in 0.04s]
[0m07:21:16.139686 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m07:21:16.139686 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:21:16.139686 [info ] [Thread-1 (]: 39 of 51 START test not_null_dim_classe_instituicao_id_classe .................. [RUN]
[0m07:21:16.141310 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m07:21:16.141310 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:21:16.143407 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:21:16.145070 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:21:16.147208 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:21:16.147208 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:21:16.148787 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m07:21:16.148787 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.149794 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.149794 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m07:21:16.150299 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m07:21:16.150805 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.151404 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m07:21:16.152411 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m07:21:16.153917 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m07:21:16.153917 [info ] [Thread-1 (]: 39 of 51 PASS not_null_dim_classe_instituicao_id_classe ........................ [[32mPASS[0m in 0.01s]
[0m07:21:16.153917 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m07:21:16.153917 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:21:16.153917 [info ] [Thread-1 (]: 40 of 51 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m07:21:16.156699 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m07:21:16.156699 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:21:16.161809 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:21:16.163316 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:21:16.165721 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:21:16.166979 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:21:16.166979 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m07:21:16.167985 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.169492 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.169492 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m07:21:16.169492 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:16.173033 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:16.173033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m07:21:16.175117 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m07:21:16.175117 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m07:21:16.176123 [info ] [Thread-1 (]: 40 of 51 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m07:21:16.177123 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m07:21:16.177123 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:21:16.177123 [info ] [Thread-1 (]: 41 of 51 START test unique_dim_classe_instituicao_id_classe .................... [RUN]
[0m07:21:16.178628 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m07:21:16.179144 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:21:16.183347 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:21:16.185375 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:21:16.191078 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:21:16.192590 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:21:16.192590 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m07:21:16.192590 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.193595 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.194601 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m07:21:16.194601 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:21:16.197169 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.199712 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m07:21:16.201382 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m07:21:16.201382 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m07:21:16.202396 [info ] [Thread-1 (]: 41 of 51 PASS unique_dim_classe_instituicao_id_classe .......................... [[32mPASS[0m in 0.02s]
[0m07:21:16.203900 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m07:21:16.203900 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:21:16.203900 [info ] [Thread-1 (]: 42 of 51 START test not_null_dim_consolidado_id_consolidado .................... [RUN]
[0m07:21:16.203900 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m07:21:16.203900 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:21:16.208230 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:21:16.210276 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:21:16.213395 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:21:16.216880 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:21:16.217887 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m07:21:16.218892 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.220775 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.221291 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m07:21:16.221291 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m07:21:16.222297 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.225748 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m07:21:16.226759 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m07:21:16.227264 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m07:21:16.227264 [info ] [Thread-1 (]: 42 of 51 PASS not_null_dim_consolidado_id_consolidado .......................... [[32mPASS[0m in 0.02s]
[0m07:21:16.228272 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m07:21:16.229777 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:21:16.229777 [info ] [Thread-1 (]: 43 of 51 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m07:21:16.230858 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m07:21:16.230858 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:21:16.235525 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:21:16.236533 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:21:16.239887 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:21:16.241015 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:21:16.242024 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m07:21:16.242024 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.242529 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.242529 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m07:21:16.242529 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:16.245191 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:16.246531 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m07:21:16.247742 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m07:21:16.248748 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m07:21:16.249812 [info ] [Thread-1 (]: 43 of 51 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.02s]
[0m07:21:16.251405 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m07:21:16.252446 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:21:16.253952 [info ] [Thread-1 (]: 44 of 51 START test unique_dim_consolidado_id_consolidado ...................... [RUN]
[0m07:21:16.253952 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m07:21:16.253952 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:21:16.257051 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:21:16.259558 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:21:16.261841 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:21:16.263360 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:21:16.263360 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m07:21:16.263360 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.265063 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.265854 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m07:21:16.265854 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:21:16.268186 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.270706 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m07:21:16.272317 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m07:21:16.272317 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m07:21:16.273325 [info ] [Thread-1 (]: 44 of 51 PASS unique_dim_consolidado_id_consolidado ............................ [[32mPASS[0m in 0.02s]
[0m07:21:16.274338 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m07:21:16.274890 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:21:16.274890 [info ] [Thread-1 (]: 45 of 51 START test not_null_dim_controle_id_controle .......................... [RUN]
[0m07:21:16.275479 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m07:21:16.276519 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:21:16.280021 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:21:16.281027 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:21:16.283044 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:21:16.284107 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:21:16.284666 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m07:21:16.285670 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.285670 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.287635 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m07:21:16.288391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m07:21:16.288907 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.290920 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m07:21:16.291927 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m07:21:16.293800 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m07:21:16.293800 [info ] [Thread-1 (]: 45 of 51 PASS not_null_dim_controle_id_controle ................................ [[32mPASS[0m in 0.02s]
[0m07:21:16.294818 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m07:21:16.294818 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:21:16.294818 [info ] [Thread-1 (]: 46 of 51 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m07:21:16.296372 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m07:21:16.296971 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:21:16.308601 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:21:16.311646 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:21:16.314920 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:21:16.316747 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:21:16.318278 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m07:21:16.318813 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.320889 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m07:21:16.323056 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m07:21:16.323562 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:16.326090 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:16.329096 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m07:21:16.331126 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m07:21:16.331126 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m07:21:16.332155 [info ] [Thread-1 (]: 46 of 51 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.04s]
[0m07:21:16.332155 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m07:21:16.333566 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:21:16.333566 [info ] [Thread-1 (]: 47 of 51 START test unique_dim_controle_id_controle ............................ [RUN]
[0m07:21:16.334720 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m07:21:16.336281 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:21:16.339951 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:21:16.340956 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:21:16.343473 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:21:16.345120 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:21:16.345120 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m07:21:16.345120 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.345120 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.345120 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m07:21:16.347614 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:21:16.349137 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.349651 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m07:21:16.351373 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m07:21:16.351373 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m07:21:16.351373 [info ] [Thread-1 (]: 47 of 51 PASS unique_dim_controle_id_controle .................................. [[32mPASS[0m in 0.02s]
[0m07:21:16.352388 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m07:21:16.352388 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:21:16.352388 [info ] [Thread-1 (]: 48 of 51 START test not_null_dim_segmento_id_segmento .......................... [RUN]
[0m07:21:16.353893 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m07:21:16.353893 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:21:16.359809 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:21:16.360455 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:21:16.364542 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:21:16.366781 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:21:16.367785 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m07:21:16.367785 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.369290 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.369854 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m07:21:16.369854 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m07:21:16.373170 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:16.377057 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m07:21:16.379571 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m07:21:16.381397 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m07:21:16.384358 [info ] [Thread-1 (]: 48 of 51 PASS not_null_dim_segmento_id_segmento ................................ [[32mPASS[0m in 0.03s]
[0m07:21:16.386890 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m07:21:16.388772 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:21:16.390303 [info ] [Thread-1 (]: 49 of 51 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m07:21:16.391306 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m07:21:16.391306 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:21:16.397322 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:21:16.401536 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:21:16.406597 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:21:16.407598 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:21:16.407598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m07:21:16.408602 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.408602 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.409598 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m07:21:16.409598 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m07:21:16.411625 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.413641 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m07:21:16.414664 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m07:21:16.415944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m07:21:16.417594 [info ] [Thread-1 (]: 49 of 51 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.03s]
[0m07:21:16.419100 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m07:21:16.419100 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:21:16.419622 [info ] [Thread-1 (]: 50 of 51 START test unique_dim_segmento_id_segmento ............................ [RUN]
[0m07:21:16.419622 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m07:21:16.420629 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:21:16.425620 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:21:16.427174 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:21:16.430200 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:21:16.433036 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:21:16.433542 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m07:21:16.435787 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.438306 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:16.438306 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m07:21:16.439850 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m07:21:16.443442 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m07:21:16.445322 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m07:21:16.447010 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m07:21:16.447010 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m07:21:16.448698 [info ] [Thread-1 (]: 50 of 51 PASS unique_dim_segmento_id_segmento .................................. [[32mPASS[0m in 0.03s]
[0m07:21:16.450957 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m07:21:16.452506 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_dre_relatorios
[0m07:21:16.454016 [info ] [Thread-1 (]: 51 of 51 START sql view model main.view_dre_relatorios ......................... [RUN]
[0m07:21:16.456053 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now model.bacen_ifdata_analytics.view_dre_relatorios)
[0m07:21:16.457073 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_dre_relatorios
[0m07:21:16.472154 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m07:21:16.475437 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_dre_relatorios
[0m07:21:16.496419 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m07:21:16.498182 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m07:21:16.498182 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: BEGIN
[0m07:21:16.498708 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m07:21:16.498708 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.499923 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m07:21:16.499923 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_dre_relatorios"} */

  
  create view "gold_warehouse"."main"."view_dre_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_demonstracao_resultado"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
),
dim_classe AS (
    SELECT * FROM "gold_warehouse"."main"."dim_classe_instituicao"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    cl.descricao as classe_instituicao,
    
    -- Data
    t.data as data_base,
    
    -- DRE - Receitas Intermediação
    f.rendas_operacoes_de_credito,
    f.rendas_operacoes_de_arrendamento_mercantil,
    f.rendas_operacoes_tvm,
    f.rendas_operacoes_instrumentos_financeiros_derivativos,
    f.resultado_operacoes_cambio,
    f.rendas_aplicacoes_compulsorias,
    f.receitas_intermediacao_financeira,
    
    -- DRE - Despesas Intermediação
    f.despesas_captacao,
    f.despesas_obrigacoes_emprestimos_repasses,
    f.despesas_operacoes_arrendamento_mercantil,
    f.despesas_operacoes_cambio,
    f.resultado_provisao_creditos_dificil_liquidacao,
    f.despesas_intermediacao_financeira,
    
    -- DRE - Resultado Intermediação
    f.resultado_intermediacao_financeira,
    
    -- DRE - Outras Receitas/Despesas Operacionais
    f.rendas_prestacao_servicos,
    f.rendas_tarifas_bancarias,
    f.despesas_pessoal,
    f.despesas_administrativas,
    f.despesas_tributarias,
    f.resultado_participacoes,
    f.outras_receitas_operacionais,
    f.outras_despesas_operacionais,
    f.outras_receitas_despesas_operacionais,
    
    -- DRE - Resultados
    f.resultado_operacional,
    f.resultado_nao_operacional,
    f.resultado_antes_tributacao,
    f.imposto_renda_contribuicao_social,
    f.participacao_lucros,
    f.lucro_liquido,
    f.juros_sobre_capital,
    
    -- KPIs
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
LEFT JOIN dim_classe cl ON i.id_classe = cl.id_classe
  );

[0m07:21:16.501449 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.503984 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m07:21:16.503984 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_dre_relatorios"} */
alter view "gold_warehouse"."main"."view_dre_relatorios__dbt_tmp" rename to "view_dre_relatorios"
[0m07:21:16.505623 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.505623 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: COMMIT
[0m07:21:16.506652 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m07:21:16.506652 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: COMMIT
[0m07:21:16.508634 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m07:21:16.510274 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m07:21:16.510274 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_dre_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_dre_relatorios__dbt_backup" cascade
    
[0m07:21:16.510873 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m07:21:16.513415 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: Close
[0m07:21:16.513415 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'ae8e5bb9-b87b-470c-bdbc-8b9b7b1897f0', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D96E1580>]}
[0m07:21:16.514972 [info ] [Thread-1 (]: 51 of 51 OK created sql view model main.view_dre_relatorios .................... [[32mOK[0m in 0.06s]
[0m07:21:16.515493 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_dre_relatorios
[0m07:21:16.516589 [debug] [MainThread]: Using duckdb connection "master"
[0m07:21:16.516589 [debug] [MainThread]: On master: BEGIN
[0m07:21:16.516589 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m07:21:16.516589 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:21:16.518141 [debug] [MainThread]: On master: COMMIT
[0m07:21:16.518141 [debug] [MainThread]: Using duckdb connection "master"
[0m07:21:16.518141 [debug] [MainThread]: On master: COMMIT
[0m07:21:16.518141 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m07:21:16.519161 [debug] [MainThread]: On master: Close
[0m07:21:16.519161 [debug] [MainThread]: Connection 'master' was properly closed.
[0m07:21:16.519665 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m07:21:16.519665 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m07:21:16.519665 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_dre_relatorios' was properly closed.
[0m07:21:16.519665 [info ] [MainThread]: 
[0m07:21:16.520693 [info ] [MainThread]: Finished running 4 seeds, 8 table models, 38 data tests, 1 view model in 0 hours 0 minutes and 3.35 seconds (3.35s).
[0m07:21:16.530431 [debug] [MainThread]: Command end result
[0m07:21:16.578327 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m07:21:16.583629 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m07:21:16.591341 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m07:21:16.591341 [info ] [MainThread]: 
[0m07:21:16.592344 [info ] [MainThread]: [32mCompleted successfully[0m
[0m07:21:16.592344 [info ] [MainThread]: 
[0m07:21:16.592344 [info ] [MainThread]: Done. PASS=51 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=51
[0m07:21:16.593364 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 2 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m07:21:16.595056 [debug] [MainThread]: Command `dbt build` succeeded at 07:21:16.595056 after 4.78 seconds
[0m07:21:16.595608 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D47C1EE0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D3EAE870>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000190D7DA49E0>]}
[0m07:21:16.595608 [debug] [MainThread]: Flushing usage events
[0m07:21:17.936113 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m08:22:57.603809 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209331F1790>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020933D0EF60>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020933D0EC30>]}


============================== 08:22:57.613278 | 116ec0a5-8c23-4d66-a885-292f02517799 ==============================
[0m08:22:57.613278 [info ] [MainThread]: Running with dbt=1.11.5
[0m08:22:57.615520 [debug] [MainThread]: running dbt with arguments {'static_parser': 'True', 'no_print': 'None', 'version_check': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'empty': 'False', 'log_cache_events': 'False', 'introspect': 'True', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'invocation_command': 'dbt build', 'use_colors': 'True', 'indirect_selection': 'eager', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m08:22:57.789642 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209358E1610>]}
[0m08:22:57.834437 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020935947A70>]}
[0m08:22:57.837618 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m08:22:58.041999 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m08:22:58.146879 [info ] [MainThread]: Unable to do partial parsing because profile has changed
[0m08:22:58.148417 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020935F96600>]}
[0m08:22:59.331487 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on 'dim_instituicao'
in package 'bacen_ifdata_analytics' (models\gold\schema.yml). Arguments to
generic tests should be nested under the `arguments` property.
[0m08:22:59.332080 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020937DE7C80>]}
[0m08:22:59.652356 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m08:22:59.661778 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938148CB0>]}
[0m08:22:59.738519 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m08:22:59.740073 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m08:22:59.786231 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020937E475F0>]}
[0m08:22:59.787743 [info ] [MainThread]: Found 29 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m08:22:59.793490 [info ] [MainThread]: 
[0m08:22:59.793490 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m08:22:59.793490 [info ] [MainThread]: 
[0m08:22:59.793490 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m08:22:59.799617 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m08:22:59.864954 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m08:22:59.864954 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m08:22:59.865580 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m08:22:59.965535 [debug] [ThreadPool]: SQL status: OK in 0.100 seconds
[0m08:22:59.966635 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m08:22:59.967651 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m08:22:59.967651 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m08:22:59.979787 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m08:22:59.979787 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m08:22:59.979787 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m08:22:59.982300 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m08:22:59.983440 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m08:22:59.983993 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m08:22:59.985007 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m08:22:59.985007 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m08:22:59.985645 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m08:22:59.985645 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m08:22:59.987672 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m08:22:59.987672 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m08:22:59.988362 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m08:22:59.988362 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m08:22:59.989390 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m08:22:59.994007 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m08:22:59.999451 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m08:22:59.999451 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m08:23:00.000472 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m08:23:00.000990 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m08:23:00.001506 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m08:23:00.001506 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m08:23:00.024120 [debug] [ThreadPool]: SQL status: OK in 0.021 seconds
[0m08:23:00.027696 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m08:23:00.032218 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m08:23:00.033228 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m08:23:00.034537 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020937DB0AD0>]}
[0m08:23:00.035549 [debug] [MainThread]: Using duckdb connection "master"
[0m08:23:00.036658 [debug] [MainThread]: On master: BEGIN
[0m08:23:00.036658 [debug] [MainThread]: Opening a new connection, currently in state init
[0m08:23:00.038488 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m08:23:00.038488 [debug] [MainThread]: On master: COMMIT
[0m08:23:00.039512 [debug] [MainThread]: Using duckdb connection "master"
[0m08:23:00.039512 [debug] [MainThread]: On master: COMMIT
[0m08:23:00.041271 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m08:23:00.041807 [debug] [MainThread]: On master: Close
[0m08:23:00.058795 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m08:23:00.060830 [info ] [Thread-1 (]: 1 of 100 START sql table model main.dim_instituicao ............................ [RUN]
[0m08:23:00.063520 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m08:23:00.063520 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m08:23:00.101493 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:23:00.103540 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m08:23:00.143243 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:23:00.144855 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:23:00.144855 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m08:23:00.144855 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m08:23:00.146374 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:00.146374 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:23:00.147110 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m08:23:00.761094 [debug] [Thread-1 (]: SQL status: OK in 0.613 seconds
[0m08:23:00.767765 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:23:00.767765 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m08:23:00.769272 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:00.783640 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m08:23:00.784145 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:23:00.784878 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m08:23:00.808216 [debug] [Thread-1 (]: SQL status: OK in 0.022 seconds
[0m08:23:00.820062 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:23:00.821572 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m08:23:00.822603 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:00.829239 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m08:23:00.834978 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209332CDCD0>]}
[0m08:23:00.837553 [info ] [Thread-1 (]: 1 of 100 OK created sql table model main.dim_instituicao ....................... [[32mOK[0m in 0.77s]
[0m08:23:00.839289 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m08:23:00.840296 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m08:23:00.842204 [info ] [Thread-1 (]: 2 of 100 START sql table model main.dim_localizacao ............................ [RUN]
[0m08:23:00.843746 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m08:23:00.844765 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m08:23:00.854148 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:23:00.857899 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m08:23:00.863282 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:23:00.866820 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:23:00.867364 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m08:23:00.868378 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:00.871028 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:00.871676 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:23:00.873132 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m08:23:01.015546 [debug] [Thread-1 (]: SQL status: OK in 0.141 seconds
[0m08:23:01.019196 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:23:01.020808 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m08:23:01.022457 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:01.026151 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m08:23:01.027178 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:23:01.027178 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m08:23:01.031792 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:23:01.038209 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:23:01.038209 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m08:23:01.039228 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:01.043201 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m08:23:01.044339 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002093885FB00>]}
[0m08:23:01.045491 [info ] [Thread-1 (]: 2 of 100 OK created sql table model main.dim_localizacao ....................... [[32mOK[0m in 0.20s]
[0m08:23:01.047297 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m08:23:01.047819 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m08:23:01.049453 [info ] [Thread-1 (]: 3 of 100 START sql table model main.dim_tempo .................................. [RUN]
[0m08:23:01.051147 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m08:23:01.051757 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m08:23:01.074475 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m08:23:01.076575 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m08:23:01.085574 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m08:23:01.087097 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:23:01.088408 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m08:23:01.089442 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:01.090969 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:01.091689 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:23:01.092718 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m08:23:01.202457 [debug] [Thread-1 (]: SQL status: OK in 0.108 seconds
[0m08:23:01.210810 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:23:01.211372 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m08:23:01.213896 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:01.216728 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m08:23:01.216728 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:23:01.217872 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m08:23:01.221967 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:01.227939 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:23:01.227939 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m08:23:01.229548 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:01.234157 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m08:23:01.234934 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209386BCD70>]}
[0m08:23:01.236672 [info ] [Thread-1 (]: 3 of 100 OK created sql table model main.dim_tempo ............................. [[32mOK[0m in 0.19s]
[0m08:23:01.238451 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m08:23:01.239458 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m08:23:01.240991 [info ] [Thread-1 (]: 4 of 100 START sql table model main.fato_balanco_patrimonial ................... [RUN]
[0m08:23:01.242090 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m08:23:01.244250 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m08:23:01.260315 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:23:01.263126 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m08:23:01.271172 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:23:01.274691 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:23:01.275805 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m08:23:01.277042 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:01.278150 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:01.279773 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:23:01.281658 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos (Prudential version with accents on some cols)
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    
    -- Passivos (Novas Contas Inseridas)
    depositos_vista,
    depositos_poupanca,
    depositos_interfinanceiros,
    depositos_a_prazo,
    conta_de_pagamento_pre_paga,
    depositos_outros,
    depositos,
    captacoes_mercado_aberto,
    letras_de_credito_imobiliario,
    letras_de_credito_agronegocio,
    letras_financeiras,
    obrigacoes_titulos_e_valores_mobiliarios_exterior,
    outros_recursos_de_aceites_e_emissao_de_titulos,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    captacoes,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total

FROM unificacao
    );
  
  
[0m08:23:03.082008 [debug] [Thread-1 (]: SQL status: OK in 1.798 seconds
[0m08:23:03.086734 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:23:03.086734 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m08:23:03.088246 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:03.088246 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m08:23:03.089767 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:23:03.090774 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m08:23:03.324037 [debug] [Thread-1 (]: SQL status: OK in 0.233 seconds
[0m08:23:03.326720 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:23:03.326720 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m08:23:03.328289 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:03.331050 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m08:23:03.332193 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938323E90>]}
[0m08:23:03.332748 [info ] [Thread-1 (]: 4 of 100 OK created sql table model main.fato_balanco_patrimonial .............. [[32mOK[0m in 2.09s]
[0m08:23:03.333781 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m08:23:03.334299 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m08:23:03.335338 [info ] [Thread-1 (]: 5 of 100 START sql table model main.fato_capital_prudencial .................... [RUN]
[0m08:23:03.335338 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_capital_prudencial)
[0m08:23:03.336585 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m08:23:03.343479 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m08:23:03.344996 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m08:23:03.350639 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m08:23:03.352153 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m08:23:03.352659 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: BEGIN
[0m08:23:03.352659 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:03.354683 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:03.355190 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m08:23:03.355714 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp"
  
    as (
      

-- Prudential Conglomerates (has all columns)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Prudencial')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    -- Capital & Patrimônio de Referência
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    -- RWA (Risk Weighted Assets) e suas parcelas
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    rwasp as rwa_servicos_pagamento,
    
    -- Detalhamento RWA Mercado
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    rwacva as rwa_cva,
    rwadrc as rwa_drc,
    
    -- Exposição e Índices
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    adicional_capital_principal

FROM "silver"."main"."prudential_conglomerates_capital_information"

UNION ALL

-- Financial Conglomerates (lacks: rwasp, rwacva, rwadrc, adicional_capital_principal)
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    capital_principal_para_comparacao_com_rwa as capital_principal,
    capital_complementar,
    patrimonio_referencia_nivel_i_para_comparacao_com_rwa as pr_nivel_1,
    capital_nivel_ii as capital_nivel_2,
    patrimonio_referencia_para_comparacao_com_rwa as pr_total,
    
    ativos_ponderados_pelo_risco_rwa as rwa_total,
    rwa_risco_credito,
    rwa_risco_mercado,
    rwa_risco_operacional,
    NULL as rwa_servicos_pagamento,
    
    rwacam as rwa_cambio,
    rwacom as rwa_commodities,
    rwajur as rwa_juros,
    rwaacs as rwa_acoes,
    NULL as rwa_cva,
    NULL as rwa_drc,
    
    exposicao_total,
    indice_capital_principal,
    indice_capital_nivel_i,
    indice_basileia,
    razao_alavancagem,
    indice_imobilizacao,
    NULL as adicional_capital_principal

FROM "silver"."main"."financial_conglomerates_capital_information"
    );
  
  
[0m08:23:03.601421 [debug] [Thread-1 (]: SQL status: OK in 0.245 seconds
[0m08:23:03.606013 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m08:23:03.606013 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */
alter table "gold_warehouse"."main"."fato_capital_prudencial__dbt_tmp" rename to "fato_capital_prudencial"
[0m08:23:03.607753 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:03.609840 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m08:23:03.610861 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m08:23:03.610861 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: COMMIT
[0m08:23:03.630037 [debug] [Thread-1 (]: SQL status: OK in 0.018 seconds
[0m08:23:03.635395 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_capital_prudencial"
[0m08:23:03.637113 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_capital_prudencial"} */

      drop table if exists "gold_warehouse"."main"."fato_capital_prudencial__dbt_backup" cascade
    
[0m08:23:03.637651 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:03.640225 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_capital_prudencial: Close
[0m08:23:03.641255 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938857650>]}
[0m08:23:03.642327 [info ] [Thread-1 (]: 5 of 100 OK created sql table model main.fato_capital_prudencial ............... [[32mOK[0m in 0.31s]
[0m08:23:03.643343 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_capital_prudencial
[0m08:23:03.643343 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m08:23:03.643343 [info ] [Thread-1 (]: 6 of 100 START sql table model main.fato_carteira_credito_indexador ............ [RUN]
[0m08:23:03.644954 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_capital_prudencial, now model.bacen_ifdata_analytics.fato_carteira_credito_indexador)
[0m08:23:03.644954 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m08:23:03.649881 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m08:23:03.651394 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m08:23:03.655434 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m08:23:03.657004 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m08:23:03.658600 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: BEGIN
[0m08:23:03.659611 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:03.660806 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:03.661322 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m08:23:03.661322 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp"
  
    as (
      

-- Financial Conglomerates Indexer
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_portfolio_indexer"

UNION ALL

-- Financial Conglomerates SCR Indexer
-- SCR table lacks: tlp, tcr_pre, tcr_pos, trfc_pre, trfc_pos
SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Conglomerado Financeiro (SCR)')
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    
    total_geral as total_carteira,
    
    prefixado,
    selic,
    carteira_ativa_com_indexador_cdi as cdi,
    tr_tbf as tr,
    tjlp,
    NULL as tlp,
    libor,
    
    ipca,
    igpm,
    ipcc,
    outros_indices_de_preco,
    
    outras_taxas_pos_fixadas,
    outras_taxas_flutuantes,
    outros_indexadores,
    
    total_exterior,
    
    total_nao_individualizado

FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    );
  
  
[0m08:23:03.709982 [debug] [Thread-1 (]: SQL status: OK in 0.048 seconds
[0m08:23:03.713277 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m08:23:03.713277 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_tmp" rename to "fato_carteira_credito_indexador"
[0m08:23:03.714304 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:03.716456 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m08:23:03.716456 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m08:23:03.716990 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: COMMIT
[0m08:23:03.737962 [debug] [Thread-1 (]: SQL status: OK in 0.021 seconds
[0m08:23:03.740697 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"
[0m08:23:03.741216 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_indexador"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_indexador__dbt_backup" cascade
    
[0m08:23:03.742224 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:03.743236 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_indexador: Close
[0m08:23:03.743755 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002093885E510>]}
[0m08:23:03.745272 [info ] [Thread-1 (]: 6 of 100 OK created sql table model main.fato_carteira_credito_indexador ....... [[32mOK[0m in 0.10s]
[0m08:23:03.745272 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_indexador
[0m08:23:03.746281 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m08:23:03.747328 [info ] [Thread-1 (]: 7 of 100 START sql table model main.fato_carteira_credito_totais ............... [RUN]
[0m08:23:03.747328 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_indexador, now model.bacen_ifdata_analytics.fato_carteira_credito_totais)
[0m08:23:03.748337 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m08:23:03.752524 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m08:23:03.753598 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m08:23:03.756256 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m08:23:03.757770 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m08:23:03.757770 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: BEGIN
[0m08:23:03.757770 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:03.758776 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:03.758776 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m08:23:03.758776 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp"
  
    as (
      

WITH totais AS (
    -- =================================================================================================
    -- PESSOA JURÍDICA (PJ)
    -- =================================================================================================
    
    -- Conglomerados Financeiros - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_carteira_pessoa_juridica as total_carteira_pj,
        total_nao_individualizado_pessoa_juridica as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"

    UNION ALL

    -- SCR - Atividade Econômica
    SELECT 
        codigo,
        data_base,
        total_da_carteira_de_pessoa_juridica as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        total_exterior_pessoa_juridica as total_exterior_pj,
        NULL as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"

    UNION ALL

    -- =================================================================================================
    -- RISCO (TOTAL GERAL)
    -- =================================================================================================

    -- Conglomerados Financeiros - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"

    UNION ALL

    -- SCR - Risco
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        total_geral as total_geral_risco,
        NULL as total_carteira_pf,
        NULL as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"

    UNION ALL

    -- =================================================================================================
    -- PESSOA FÍSICA (PF)
    -- =================================================================================================

    -- Conglomerados Financeiros - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_carteira_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"

    UNION ALL

    -- SCR - PF Tipo/Vencimento
    SELECT
        codigo,
        data_base,
        NULL as total_carteira_pj,
        NULL as total_nao_individualizado_pj,
        NULL as total_exterior_pj,
        NULL as total_geral_risco,
        total_da_carteira_de_pessoa_fisica as total_carteira_pf,
        total_exterior_pessoa_fisica as total_exterior_pf,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    -- Agregando por instituição e data
    MAX(total_carteira_pj) as total_carteira_pj,
    MAX(total_nao_individualizado_pj) as total_nao_individualizado_pj,
    MAX(total_exterior_pj) as total_exterior_pj,
    MAX(total_geral_risco) as total_geral_risco,
    MAX(total_carteira_pf) as total_carteira_pf,
    MAX(total_exterior_pf) as total_exterior_pf
FROM totais
GROUP BY 1, 2
    );
  
  
[0m08:23:03.806297 [debug] [Thread-1 (]: SQL status: OK in 0.048 seconds
[0m08:23:03.812685 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m08:23:03.813208 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_tmp" rename to "fato_carteira_credito_totais"
[0m08:23:03.814231 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:03.814231 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m08:23:03.815317 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m08:23:03.815928 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: COMMIT
[0m08:23:03.899385 [debug] [Thread-1 (]: SQL status: OK in 0.083 seconds
[0m08:23:03.901493 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_totais"
[0m08:23:03.902518 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_totais"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_totais__dbt_backup" cascade
    
[0m08:23:03.902518 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:03.904128 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_totais: Close
[0m08:23:03.904128 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209582A9C40>]}
[0m08:23:03.904128 [info ] [Thread-1 (]: 7 of 100 OK created sql table model main.fato_carteira_credito_totais .......... [[32mOK[0m in 0.16s]
[0m08:23:03.905657 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_totais
[0m08:23:03.905657 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m08:23:03.907216 [info ] [Thread-1 (]: 8 of 100 START sql table model main.fato_demonstracao_resultado ................ [RUN]
[0m08:23:03.907216 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_totais, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m08:23:03.907216 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m08:23:03.913785 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:23:03.914299 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m08:23:03.918629 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:23:03.919137 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:23:03.920701 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m08:23:03.920701 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:03.920701 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:03.920701 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:23:03.922260 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio as resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_proprio as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    resultado_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital,
    roe,
    roa
FROM dre
    );
  
  
[0m08:23:04.768731 [debug] [Thread-1 (]: SQL status: OK in 0.846 seconds
[0m08:23:04.772358 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:23:04.772358 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m08:23:04.773869 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:04.776568 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m08:23:04.776568 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:23:04.776568 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m08:23:04.946538 [debug] [Thread-1 (]: SQL status: OK in 0.169 seconds
[0m08:23:04.949355 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:23:04.949355 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m08:23:04.950874 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:04.952066 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m08:23:04.953077 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002093889CB60>]}
[0m08:23:04.953584 [info ] [Thread-1 (]: 8 of 100 OK created sql table model main.fato_demonstracao_resultado ........... [[32mOK[0m in 1.05s]
[0m08:23:04.954595 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m08:23:04.955799 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m08:23:04.955799 [info ] [Thread-1 (]: 9 of 100 START sql table model main.fato_movimentacao_cambio ................... [RUN]
[0m08:23:04.957421 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_movimentacao_cambio)
[0m08:23:04.957421 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m08:23:04.961133 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m08:23:04.963148 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m08:23:04.967630 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m08:23:04.969395 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m08:23:04.969395 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: BEGIN
[0m08:23:04.970968 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:04.972133 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:04.972649 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m08:23:04.972649 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp"
  
    as (
      

SELECT
    -- Chaves Estrangeiras
    
    
        md5(cast(cast(codigo as bigint) as varchar) || 'Instituição de Câmbio')
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    
    -- Métricas de Operações Comerciais (Exportação/Importação)
    operacoes_comerciais_compra_numero_operacoes,
    operacoes_comerciais_compra_valor,
    operacoes_comerciais_venda_numero_operacoes,
    operacoes_comerciais_venda_valor,
    operacoes_comerciais_total_numero_operacoes,
    operacoes_comerciais_total_valor,

    -- Métricas de Operações Financeiras
    operacoes_financeiras_compra_numero_operacoes,
    operacoes_financeiras_compra_valor,
    operacoes_financeiras_venda_numero_operacoes,
    operacoes_financeiras_venda_valor,
    operacoes_financeiras_total_numero_operacoes,
    operacoes_financeiras_total_valor,

    -- Métricas do Mercado Primário
    mercado_primario_total_numero_operacoes,
    mercado_primario_total_valor,

    -- Métricas do Mercado Interbancário
    mercado_interbancario_compra_numero_operacoes,
    mercado_interbancario_compra_valor,
    mercado_interbancario_venda_numero_operacoes,
    mercado_interbancario_venda_valor,
    mercado_interbancario_total_numero_operacoes,
    mercado_interbancario_total_valor,

    -- Totais Gerais
    total_geral_numero_operacoes,
    total_geral_valor

FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
WHERE data_base IS NOT NULL
    );
  
  
[0m08:23:04.980042 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m08:23:04.984287 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m08:23:04.984803 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */
alter table "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_tmp" rename to "fato_movimentacao_cambio"
[0m08:23:04.985345 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:04.987954 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m08:23:04.988690 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m08:23:04.988690 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: COMMIT
[0m08:23:04.995388 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m08:23:05.000681 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_movimentacao_cambio"
[0m08:23:05.001726 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_movimentacao_cambio"} */

      drop table if exists "gold_warehouse"."main"."fato_movimentacao_cambio__dbt_backup" cascade
    
[0m08:23:05.003432 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:05.006170 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_movimentacao_cambio: Close
[0m08:23:05.006170 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209582CDA30>]}
[0m08:23:05.007806 [info ] [Thread-1 (]: 9 of 100 OK created sql table model main.fato_movimentacao_cambio .............. [[32mOK[0m in 0.05s]
[0m08:23:05.009880 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_movimentacao_cambio
[0m08:23:05.010569 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m08:23:05.011083 [info ] [Thread-1 (]: 10 of 100 START sql table model main.fato_operacoes_clientes ................... [RUN]
[0m08:23:05.011083 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_movimentacao_cambio, now model.bacen_ifdata_analytics.fato_operacoes_clientes)
[0m08:23:05.011083 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m08:23:05.019386 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m08:23:05.020926 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m08:23:05.026684 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m08:23:05.029291 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m08:23:05.029802 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: BEGIN
[0m08:23:05.031460 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:05.033096 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:05.033096 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m08:23:05.034781 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp"
  
    as (
      

WITH operacoes AS (
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    
    UNION ALL
    
    SELECT
        codigo,
        data_base,
        quantidade_de_clientes_com_operacoes_ativas as quantidade_clientes,
        quantidade_de_operacoes_ativas as quantidade_operacoes,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    quantidade_clientes,
    quantidade_operacoes
FROM operacoes
    );
  
  
[0m08:23:05.086658 [debug] [Thread-1 (]: SQL status: OK in 0.051 seconds
[0m08:23:05.088392 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m08:23:05.088392 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */
alter table "gold_warehouse"."main"."fato_operacoes_clientes__dbt_tmp" rename to "fato_operacoes_clientes"
[0m08:23:05.090572 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:05.092193 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m08:23:05.092193 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m08:23:05.092193 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: COMMIT
[0m08:23:05.104044 [debug] [Thread-1 (]: SQL status: OK in 0.012 seconds
[0m08:23:05.110472 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_operacoes_clientes"
[0m08:23:05.110472 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_operacoes_clientes"} */

      drop table if exists "gold_warehouse"."main"."fato_operacoes_clientes__dbt_backup" cascade
    
[0m08:23:05.113200 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:05.114213 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_operacoes_clientes: Close
[0m08:23:05.114213 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209387E9FD0>]}
[0m08:23:05.115240 [info ] [Thread-1 (]: 10 of 100 OK created sql table model main.fato_operacoes_clientes .............. [[32mOK[0m in 0.10s]
[0m08:23:05.116691 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_operacoes_clientes
[0m08:23:05.116691 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m08:23:05.117703 [info ] [Thread-1 (]: 11 of 100 START sql table model main.fato_resumo_financeiro .................... [RUN]
[0m08:23:05.118212 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_operacoes_clientes, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m08:23:05.119224 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m08:23:05.129043 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:23:05.131095 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m08:23:05.135584 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:23:05.137920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:23:05.138476 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m08:23:05.138476 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:05.140132 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:05.141151 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:23:05.142200 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m08:23:05.516497 [debug] [Thread-1 (]: SQL status: OK in 0.374 seconds
[0m08:23:05.519253 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:23:05.520288 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m08:23:05.520814 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:05.522376 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m08:23:05.522376 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:23:05.522376 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m08:23:05.808845 [debug] [Thread-1 (]: SQL status: OK in 0.286 seconds
[0m08:23:05.811432 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:23:05.812951 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m08:23:05.812951 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:05.814543 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m08:23:05.815556 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938851430>]}
[0m08:23:05.816068 [info ] [Thread-1 (]: 11 of 100 OK created sql table model main.fato_resumo_financeiro ............... [[32mOK[0m in 0.70s]
[0m08:23:05.817223 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m08:23:05.817223 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m08:23:05.817223 [info ] [Thread-1 (]: 12 of 100 START seed file main.seed_dim_atividade .............................. [RUN]
[0m08:23:05.818870 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_atividade)
[0m08:23:05.818870 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m08:23:05.818870 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m08:23:05.848728 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m08:23:05.849249 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: BEGIN
[0m08:23:05.849249 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:05.849249 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:05.850585 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m08:23:05.850585 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_atividade"} */

    create table "gold_warehouse"."main"."seed_dim_atividade" ("id_atividade" integer,"nome_atividade" text,"prefixo_coluna" text)
  
[0m08:23:05.852219 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:05.862975 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m08:23:05.862975 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: 
          COPY "gold_warehouse"."main"."seed_dim_atividade" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_atividade.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:05.868982 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m08:23:05.876886 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m08:23:05.881215 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m08:23:05.882247 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_atividade"
[0m08:23:05.883350 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: COMMIT
[0m08:23:05.886430 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:05.888810 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_atividade: Close
[0m08:23:05.889837 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938841460>]}
[0m08:23:05.890878 [info ] [Thread-1 (]: 12 of 100 OK loaded seed file main.seed_dim_atividade .......................... [[32mINSERT 10[0m in 0.07s]
[0m08:23:05.892439 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_atividade
[0m08:23:05.893562 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m08:23:05.895288 [info ] [Thread-1 (]: 13 of 100 START seed file main.seed_dim_classe_instituicao ..................... [RUN]
[0m08:23:05.896549 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_atividade, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m08:23:05.897190 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m08:23:05.897190 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m08:23:05.905616 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:23:05.907403 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m08:23:05.907819 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:05.908830 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:05.909937 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:23:05.909937 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */

    create table "gold_warehouse"."main"."seed_dim_classe_instituicao" ("codigo" integer,"descricao" text)
  
[0m08:23:05.910558 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:05.913289 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:23:05.914455 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:05.917470 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:05.917470 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:23:05.920647 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m08:23:05.920647 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:23:05.922360 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m08:23:05.924670 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:05.925852 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m08:23:05.927407 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002093889CA10>]}
[0m08:23:05.928965 [info ] [Thread-1 (]: 13 of 100 OK loaded seed file main.seed_dim_classe_instituicao ................. [[32mINSERT 32[0m in 0.03s]
[0m08:23:05.930531 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m08:23:05.931147 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m08:23:05.931805 [info ] [Thread-1 (]: 14 of 100 START seed file main.seed_dim_consolidado ............................ [RUN]
[0m08:23:05.932818 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m08:23:05.933325 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m08:23:05.933836 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m08:23:05.939260 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:23:05.939260 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m08:23:05.939260 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:05.939260 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:05.940780 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:23:05.940780 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */

    create table "gold_warehouse"."main"."seed_dim_consolidado" ("codigo" text,"descricao" text)
  
[0m08:23:05.943071 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:05.944113 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:23:05.945120 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:05.947671 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:05.948677 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:23:05.951424 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m08:23:05.951424 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:23:05.951424 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m08:23:05.954774 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:05.957056 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m08:23:05.958160 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938852E40>]}
[0m08:23:05.959283 [info ] [Thread-1 (]: 14 of 100 OK loaded seed file main.seed_dim_consolidado ........................ [[32mINSERT 8[0m in 0.03s]
[0m08:23:05.959892 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m08:23:05.960523 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m08:23:05.960523 [info ] [Thread-1 (]: 15 of 100 START seed file main.seed_dim_controle ............................... [RUN]
[0m08:23:05.961530 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m08:23:05.962036 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m08:23:05.962036 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m08:23:05.967138 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:23:05.969186 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m08:23:05.970236 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:05.970767 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:05.972294 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:23:05.972294 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */

    create table "gold_warehouse"."main"."seed_dim_controle" ("codigo" integer,"descricao" text)
  
[0m08:23:05.973312 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:05.976142 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:23:05.976142 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:05.979286 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:05.980697 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:23:05.982728 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m08:23:05.983845 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:23:05.984967 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m08:23:05.987200 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:05.987812 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m08:23:05.988791 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209386BE630>]}
[0m08:23:05.988791 [info ] [Thread-1 (]: 15 of 100 OK loaded seed file main.seed_dim_controle ........................... [[32mINSERT 3[0m in 0.03s]
[0m08:23:05.991063 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m08:23:05.992072 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m08:23:05.992072 [info ] [Thread-1 (]: 16 of 100 START seed file main.seed_dim_faixa_vencimento ....................... [RUN]
[0m08:23:05.993694 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento)
[0m08:23:05.993694 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m08:23:05.993694 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m08:23:06.000369 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m08:23:06.000875 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: BEGIN
[0m08:23:06.000875 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.001395 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.001395 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m08:23:06.003132 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"} */

    create table "gold_warehouse"."main"."seed_dim_faixa_vencimento" ("id_faixa" integer,"nome_faixa" text,"ordem" integer,"sufixo_coluna" text)
  
[0m08:23:06.004158 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.005432 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m08:23:06.005432 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: 
          COPY "gold_warehouse"."main"."seed_dim_faixa_vencimento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_faixa_vencimento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:06.010519 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:23:06.010519 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m08:23:06.014541 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m08:23:06.015058 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento"
[0m08:23:06.015576 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: COMMIT
[0m08:23:06.016741 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.019009 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento: Close
[0m08:23:06.020024 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938897470>]}
[0m08:23:06.020660 [info ] [Thread-1 (]: 16 of 100 OK loaded seed file main.seed_dim_faixa_vencimento ................... [[32mINSERT 7[0m in 0.03s]
[0m08:23:06.022253 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento
[0m08:23:06.024298 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m08:23:06.024823 [info ] [Thread-1 (]: 17 of 100 START seed file main.seed_dim_porte .................................. [RUN]
[0m08:23:06.026251 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_faixa_vencimento, now seed.bacen_ifdata_analytics.seed_dim_porte)
[0m08:23:06.026251 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_porte
[0m08:23:06.026251 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_porte
[0m08:23:06.031740 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m08:23:06.033343 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: BEGIN
[0m08:23:06.033343 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.035119 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:06.035696 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m08:23:06.035696 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_porte"} */

    create table "gold_warehouse"."main"."seed_dim_porte" ("id_porte" integer,"nome_porte" text,"coluna" text)
  
[0m08:23:06.036268 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:06.038636 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m08:23:06.039176 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: 
          COPY "gold_warehouse"."main"."seed_dim_porte" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_porte.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:06.042166 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:06.042681 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m08:23:06.045720 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m08:23:06.046224 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_porte"
[0m08:23:06.046224 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: COMMIT
[0m08:23:06.049335 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:06.049864 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_porte: Close
[0m08:23:06.050897 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938825400>]}
[0m08:23:06.051947 [info ] [Thread-1 (]: 17 of 100 OK loaded seed file main.seed_dim_porte .............................. [[32mINSERT 6[0m in 0.02s]
[0m08:23:06.053475 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_porte
[0m08:23:06.053987 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m08:23:06.054530 [info ] [Thread-1 (]: 18 of 100 START seed file main.seed_dim_produto_credito ........................ [RUN]
[0m08:23:06.055536 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_porte, now seed.bacen_ifdata_analytics.seed_dim_produto_credito)
[0m08:23:06.056042 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m08:23:06.056042 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m08:23:06.062371 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m08:23:06.063383 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: BEGIN
[0m08:23:06.063383 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.064420 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.064420 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m08:23:06.064420 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_produto_credito"} */

    create table "gold_warehouse"."main"."seed_dim_produto_credito" ("id_produto" integer,"nome_produto" text,"tipo_pessoa" text,"prefixo_coluna" text)
  
[0m08:23:06.064420 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:06.157889 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m08:23:06.158999 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: 
          COPY "gold_warehouse"."main"."seed_dim_produto_credito" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_produto_credito.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:06.161922 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:06.163576 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m08:23:06.166179 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m08:23:06.166685 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_produto_credito"
[0m08:23:06.167198 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: COMMIT
[0m08:23:06.167198 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.169544 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_produto_credito: Close
[0m08:23:06.170658 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209582F5190>]}
[0m08:23:06.171284 [info ] [Thread-1 (]: 18 of 100 OK loaded seed file main.seed_dim_produto_credito .................... [[32mINSERT 14[0m in 0.11s]
[0m08:23:06.171918 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_produto_credito
[0m08:23:06.173532 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m08:23:06.173532 [info ] [Thread-1 (]: 19 of 100 START seed file main.seed_dim_regiao ................................. [RUN]
[0m08:23:06.173532 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_produto_credito, now seed.bacen_ifdata_analytics.seed_dim_regiao)
[0m08:23:06.174723 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m08:23:06.174723 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m08:23:06.180813 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m08:23:06.180813 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: BEGIN
[0m08:23:06.180813 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.182486 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.183495 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m08:23:06.183495 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_regiao"} */

    create table "gold_warehouse"."main"."seed_dim_regiao" ("id_regiao" integer,"nome_regiao" text,"coluna" text)
  
[0m08:23:06.184589 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:06.185664 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m08:23:06.185664 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: 
          COPY "gold_warehouse"."main"."seed_dim_regiao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_regiao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:06.188233 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:06.188233 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m08:23:06.191944 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m08:23:06.192969 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_regiao"
[0m08:23:06.193495 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: COMMIT
[0m08:23:06.194513 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.194513 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_regiao: Close
[0m08:23:06.194513 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002093884C8F0>]}
[0m08:23:06.196072 [info ] [Thread-1 (]: 19 of 100 OK loaded seed file main.seed_dim_regiao ............................. [[32mINSERT 7[0m in 0.02s]
[0m08:23:06.196072 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_regiao
[0m08:23:06.197081 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m08:23:06.197587 [info ] [Thread-1 (]: 20 of 100 START seed file main.seed_dim_risco .................................. [RUN]
[0m08:23:06.198594 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_regiao, now seed.bacen_ifdata_analytics.seed_dim_risco)
[0m08:23:06.199222 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_risco
[0m08:23:06.199222 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_risco
[0m08:23:06.204245 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m08:23:06.205250 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: BEGIN
[0m08:23:06.205765 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.205765 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.206773 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m08:23:06.206773 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_risco"} */

    create table "gold_warehouse"."main"."seed_dim_risco" ("id_risco" integer,"nome_risco" text,"coluna" text)
  
[0m08:23:06.208326 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.209845 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m08:23:06.210592 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: 
          COPY "gold_warehouse"."main"."seed_dim_risco" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_risco.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:06.214056 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:06.214568 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m08:23:06.217776 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m08:23:06.217776 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_risco"
[0m08:23:06.219290 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: COMMIT
[0m08:23:06.220822 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.220822 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_risco: Close
[0m08:23:06.222027 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209381CDFD0>]}
[0m08:23:06.223044 [info ] [Thread-1 (]: 20 of 100 OK loaded seed file main.seed_dim_risco .............................. [[32mINSERT 10[0m in 0.02s]
[0m08:23:06.224070 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_risco
[0m08:23:06.224070 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m08:23:06.224586 [info ] [Thread-1 (]: 21 of 100 START seed file main.seed_dim_segmento ............................... [RUN]
[0m08:23:06.225133 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_risco, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m08:23:06.225133 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m08:23:06.225133 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m08:23:06.229915 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:23:06.229915 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m08:23:06.230921 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.231944 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.231944 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:23:06.233459 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */

    create table "gold_warehouse"."main"."seed_dim_segmento" ("codigo" text,"descricao" text)
  
[0m08:23:06.234504 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.236572 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:23:06.236572 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:23:06.238817 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.239335 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:23:06.240852 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m08:23:06.242526 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:23:06.242526 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m08:23:06.244629 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.246142 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m08:23:06.247151 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938123BF0>]}
[0m08:23:06.247663 [info ] [Thread-1 (]: 21 of 100 OK loaded seed file main.seed_dim_segmento ........................... [[32mINSERT 5[0m in 0.02s]
[0m08:23:06.249351 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m08:23:06.249879 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m08:23:06.249879 [info ] [Thread-1 (]: 22 of 100 START test not_null_dim_instituicao_id_instituicao ................... [RUN]
[0m08:23:06.250950 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m08:23:06.251534 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m08:23:06.262813 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m08:23:06.264334 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m08:23:06.286129 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m08:23:06.288655 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m08:23:06.289160 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m08:23:06.289160 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.290164 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.290164 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m08:23:06.290164 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.291673 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.296243 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m08:23:06.297438 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m08:23:06.297438 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m08:23:06.298545 [info ] [Thread-1 (]: 22 of 100 PASS not_null_dim_instituicao_id_instituicao ......................... [[32mPASS[0m in 0.05s]
[0m08:23:06.299055 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m08:23:06.299790 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m08:23:06.300803 [info ] [Thread-1 (]: 23 of 100 START test not_null_dim_instituicao_id_localizacao ................... [RUN]
[0m08:23:06.301311 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m08:23:06.301923 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m08:23:06.306707 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m08:23:06.307713 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m08:23:06.312424 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m08:23:06.313989 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m08:23:06.314507 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m08:23:06.314507 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.315619 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.316132 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m08:23:06.316132 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.318820 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.321958 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m08:23:06.322464 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m08:23:06.322969 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m08:23:06.323493 [info ] [Thread-1 (]: 23 of 100 PASS not_null_dim_instituicao_id_localizacao ......................... [[32mPASS[0m in 0.02s]
[0m08:23:06.325013 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m08:23:06.325619 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m08:23:06.326143 [info ] [Thread-1 (]: 24 of 100 START test unique_dim_instituicao_id_instituicao ..................... [RUN]
[0m08:23:06.327661 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m08:23:06.327661 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m08:23:06.335882 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m08:23:06.335882 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m08:23:06.340142 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m08:23:06.342180 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m08:23:06.342180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m08:23:06.343192 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.343192 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.343192 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m08:23:06.343192 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:23:06.349217 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:23:06.350517 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m08:23:06.351757 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m08:23:06.351757 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m08:23:06.351757 [info ] [Thread-1 (]: 24 of 100 PASS unique_dim_instituicao_id_instituicao ........................... [[32mPASS[0m in 0.03s]
[0m08:23:06.353445 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m08:23:06.353999 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m08:23:06.355054 [info ] [Thread-1 (]: 25 of 100 START test not_null_dim_localizacao_id_localizacao ................... [RUN]
[0m08:23:06.355564 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m08:23:06.355564 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m08:23:06.360736 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m08:23:06.362353 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m08:23:06.366942 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m08:23:06.368559 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m08:23:06.369167 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m08:23:06.369838 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.370858 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.371370 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m08:23:06.371905 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.373425 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.375591 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m08:23:06.377212 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m08:23:06.377212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m08:23:06.377212 [info ] [Thread-1 (]: 25 of 100 PASS not_null_dim_localizacao_id_localizacao ......................... [[32mPASS[0m in 0.02s]
[0m08:23:06.379378 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m08:23:06.380050 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m08:23:06.380050 [info ] [Thread-1 (]: 26 of 100 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m08:23:06.381168 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m08:23:06.381676 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m08:23:06.388623 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m08:23:06.390253 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m08:23:06.394800 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m08:23:06.396431 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m08:23:06.396431 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m08:23:06.397452 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.398472 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.398984 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m08:23:06.400234 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.402056 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:06.403985 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m08:23:06.405667 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m08:23:06.405667 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m08:23:06.407444 [info ] [Thread-1 (]: 26 of 100 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m08:23:06.407444 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m08:23:06.409051 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m08:23:06.409584 [info ] [Thread-1 (]: 27 of 100 START test unique_dim_localizacao_id_localizacao ..................... [RUN]
[0m08:23:06.410691 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m08:23:06.411229 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m08:23:06.416561 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m08:23:06.418091 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m08:23:06.422191 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m08:23:06.423219 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m08:23:06.424933 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m08:23:06.425593 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.426130 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.426130 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m08:23:06.427740 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:23:06.431819 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:06.433333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m08:23:06.434862 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m08:23:06.435379 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m08:23:06.437462 [info ] [Thread-1 (]: 27 of 100 PASS unique_dim_localizacao_id_localizacao ........................... [[32mPASS[0m in 0.03s]
[0m08:23:06.438572 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m08:23:06.439685 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m08:23:06.440345 [info ] [Thread-1 (]: 28 of 100 START test not_null_dim_tempo_id_data ................................ [RUN]
[0m08:23:06.441625 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m08:23:06.442264 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m08:23:06.448642 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m08:23:06.449726 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m08:23:06.456514 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m08:23:06.458221 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m08:23:06.459758 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m08:23:06.459758 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.461273 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.461273 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m08:23:06.461273 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.462789 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.464821 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m08:23:06.465837 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m08:23:06.466388 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m08:23:06.467431 [info ] [Thread-1 (]: 28 of 100 PASS not_null_dim_tempo_id_data ...................................... [[32mPASS[0m in 0.03s]
[0m08:23:06.469009 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m08:23:06.469009 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m08:23:06.470554 [info ] [Thread-1 (]: 29 of 100 START test unique_dim_tempo_id_data .................................. [RUN]
[0m08:23:06.470554 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m08:23:06.472158 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m08:23:06.475270 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m08:23:06.476986 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m08:23:06.480126 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m08:23:06.483186 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m08:23:06.483186 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m08:23:06.483708 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.484266 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.484266 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m08:23:06.484266 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:23:06.487464 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:06.488538 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m08:23:06.490176 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m08:23:06.491185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m08:23:06.491694 [info ] [Thread-1 (]: 29 of 100 PASS unique_dim_tempo_id_data ........................................ [[32mPASS[0m in 0.02s]
[0m08:23:06.492248 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m08:23:06.492248 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m08:23:06.493254 [info ] [Thread-1 (]: 30 of 100 START test not_null_fato_balanco_patrimonial_id_data ................. [RUN]
[0m08:23:06.493758 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m08:23:06.494263 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m08:23:06.498748 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m08:23:06.500513 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m08:23:06.503200 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m08:23:06.505822 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m08:23:06.506329 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m08:23:06.506835 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.506835 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.508354 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m08:23:06.508354 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.508354 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.511058 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m08:23:06.512679 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m08:23:06.513205 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m08:23:06.513721 [info ] [Thread-1 (]: 30 of 100 PASS not_null_fato_balanco_patrimonial_id_data ....................... [[32mPASS[0m in 0.02s]
[0m08:23:06.514765 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m08:23:06.515286 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m08:23:06.515798 [info ] [Thread-1 (]: 31 of 100 START test not_null_fato_balanco_patrimonial_id_instituicao .......... [RUN]
[0m08:23:06.515798 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m08:23:06.516443 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m08:23:06.521889 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m08:23:06.523474 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m08:23:06.527974 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m08:23:06.529497 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m08:23:06.530155 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m08:23:06.530155 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.530672 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.531235 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m08:23:06.531235 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.531802 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.533358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m08:23:06.534547 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m08:23:06.535068 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m08:23:06.536592 [info ] [Thread-1 (]: 31 of 100 PASS not_null_fato_balanco_patrimonial_id_instituicao ................ [[32mPASS[0m in 0.02s]
[0m08:23:06.537598 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m08:23:06.538150 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m08:23:06.538150 [info ] [Thread-1 (]: 32 of 100 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:23:06.538952 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m08:23:06.538952 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m08:23:06.543635 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m08:23:06.545150 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m08:23:06.548199 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m08:23:06.549420 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m08:23:06.549420 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m08:23:06.551055 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.551657 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.552175 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m08:23:06.552175 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.556533 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:23:06.561080 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m08:23:06.563449 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m08:23:06.564468 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m08:23:06.566851 [info ] [Thread-1 (]: 32 of 100 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m08:23:06.567401 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m08:23:06.567401 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m08:23:06.569018 [info ] [Thread-1 (]: 33 of 100 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:23:06.569018 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m08:23:06.570633 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m08:23:06.579947 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m08:23:06.580955 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m08:23:06.583416 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m08:23:06.584390 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m08:23:06.584390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m08:23:06.585460 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.586071 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.586071 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m08:23:06.587627 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.596963 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m08:23:06.599658 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m08:23:06.600172 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m08:23:06.600686 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m08:23:06.600686 [info ] [Thread-1 (]: 33 of 100 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m08:23:06.601700 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m08:23:06.603738 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m08:23:06.603738 [info ] [Thread-1 (]: 34 of 100 START test not_null_fato_capital_prudencial_id_data .................. [RUN]
[0m08:23:06.603738 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3)
[0m08:23:06.605334 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m08:23:06.611372 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m08:23:06.613952 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m08:23:06.616023 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m08:23:06.619333 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m08:23:06.619333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: BEGIN
[0m08:23:06.621103 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.622653 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:06.623183 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"
[0m08:23:06.623183 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.624703 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:06.625714 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: ROLLBACK
[0m08:23:06.627244 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3'
[0m08:23:06.628869 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3: Close
[0m08:23:06.629385 [info ] [Thread-1 (]: 34 of 100 PASS not_null_fato_capital_prudencial_id_data ........................ [[32mPASS[0m in 0.03s]
[0m08:23:06.629962 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3
[0m08:23:06.630972 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m08:23:06.630972 [info ] [Thread-1 (]: 35 of 100 START test not_null_fato_capital_prudencial_id_instituicao ........... [RUN]
[0m08:23:06.631480 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_data.c005db50b3, now test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55)
[0m08:23:06.632128 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m08:23:06.636824 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m08:23:06.638365 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m08:23:06.642402 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m08:23:06.645044 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m08:23:06.645556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: BEGIN
[0m08:23:06.645556 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.646591 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:06.647096 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"
[0m08:23:06.647096 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_capital_prudencial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.647096 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.649780 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: ROLLBACK
[0m08:23:06.651972 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55'
[0m08:23:06.652508 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55: Close
[0m08:23:06.654050 [info ] [Thread-1 (]: 35 of 100 PASS not_null_fato_capital_prudencial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m08:23:06.654050 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55
[0m08:23:06.655597 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m08:23:06.655597 [info ] [Thread-1 (]: 36 of 100 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:23:06.655597 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_capital_prudencial_id_instituicao.7ed7e7db55, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m08:23:06.655597 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m08:23:06.663576 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m08:23:06.665766 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m08:23:06.668394 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m08:23:06.670034 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m08:23:06.670034 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m08:23:06.671193 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.672847 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.673374 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m08:23:06.673374 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.677189 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:06.679558 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m08:23:06.681300 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m08:23:06.681300 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m08:23:06.682908 [info ] [Thread-1 (]: 36 of 100 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m08:23:06.685069 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m08:23:06.685069 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m08:23:06.686078 [info ] [Thread-1 (]: 37 of 100 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:23:06.686078 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m08:23:06.686078 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m08:23:06.693723 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m08:23:06.695240 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m08:23:06.702676 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m08:23:06.705437 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m08:23:06.706306 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m08:23:06.706306 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.707313 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.707313 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m08:23:06.707313 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.716597 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m08:23:06.719963 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m08:23:06.720573 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m08:23:06.722413 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m08:23:06.723642 [info ] [Thread-1 (]: 37 of 100 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m08:23:06.724157 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m08:23:06.724752 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m08:23:06.724752 [info ] [Thread-1 (]: 38 of 100 START test not_null_fato_carteira_credito_indexador_id_data .......... [RUN]
[0m08:23:06.725265 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f)
[0m08:23:06.725265 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m08:23:06.731190 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m08:23:06.733268 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m08:23:06.736191 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m08:23:06.738558 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m08:23:06.738558 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: BEGIN
[0m08:23:06.738558 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.739565 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.739565 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"
[0m08:23:06.741110 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.743713 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.744761 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: ROLLBACK
[0m08:23:06.746318 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f'
[0m08:23:06.747362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f: Close
[0m08:23:06.748390 [info ] [Thread-1 (]: 38 of 100 PASS not_null_fato_carteira_credito_indexador_id_data ................ [[32mPASS[0m in 0.02s]
[0m08:23:06.749561 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f
[0m08:23:06.750072 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m08:23:06.750072 [info ] [Thread-1 (]: 39 of 100 START test not_null_fato_carteira_credito_indexador_id_instituicao ... [RUN]
[0m08:23:06.750580 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_data.8fc078031f, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22)
[0m08:23:06.751275 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m08:23:06.755855 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m08:23:06.757424 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m08:23:06.759971 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m08:23:06.762757 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m08:23:06.763276 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: BEGIN
[0m08:23:06.763276 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.764301 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.764810 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"
[0m08:23:06.764810 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_indexador"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.766555 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.768679 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: ROLLBACK
[0m08:23:06.769893 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22'
[0m08:23:06.769893 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22: Close
[0m08:23:06.770913 [info ] [Thread-1 (]: 39 of 100 PASS not_null_fato_carteira_credito_indexador_id_instituicao ......... [[32mPASS[0m in 0.02s]
[0m08:23:06.771974 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22
[0m08:23:06.771974 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m08:23:06.772979 [info ] [Thread-1 (]: 40 of 100 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:23:06.772979 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_indexador_id_instituicao.a75109cf22, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m08:23:06.772979 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m08:23:06.781166 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m08:23:06.781689 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m08:23:06.786427 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m08:23:06.788005 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m08:23:06.788005 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m08:23:06.789011 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.789011 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.789011 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m08:23:06.790472 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.793684 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:06.795301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m08:23:06.797444 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m08:23:06.798520 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m08:23:06.799549 [info ] [Thread-1 (]: 40 of 100 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m08:23:06.801860 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m08:23:06.801860 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m08:23:06.802373 [info ] [Thread-1 (]: 41 of 100 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:23:06.802373 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m08:23:06.802373 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m08:23:06.809052 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m08:23:06.811366 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m08:23:06.815759 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m08:23:06.817392 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m08:23:06.817392 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m08:23:06.818490 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.819119 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:06.819119 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m08:23:06.819119 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.828011 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m08:23:06.828011 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m08:23:06.829646 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m08:23:06.831498 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m08:23:06.832345 [info ] [Thread-1 (]: 41 of 100 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m08:23:06.833866 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m08:23:06.833866 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m08:23:06.833866 [info ] [Thread-1 (]: 42 of 100 START test not_null_fato_carteira_credito_totais_id_data ............. [RUN]
[0m08:23:06.834872 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6)
[0m08:23:06.835377 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m08:23:06.843495 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m08:23:06.845116 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m08:23:06.848544 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m08:23:06.849659 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m08:23:06.849659 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: BEGIN
[0m08:23:06.849659 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.850680 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.851408 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"
[0m08:23:06.852429 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.854098 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.855662 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: ROLLBACK
[0m08:23:06.858230 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6'
[0m08:23:06.858747 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6: Close
[0m08:23:06.860294 [info ] [Thread-1 (]: 42 of 100 PASS not_null_fato_carteira_credito_totais_id_data ................... [[32mPASS[0m in 0.02s]
[0m08:23:06.862039 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6
[0m08:23:06.862039 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m08:23:06.862668 [info ] [Thread-1 (]: 43 of 100 START test not_null_fato_carteira_credito_totais_id_instituicao ...... [RUN]
[0m08:23:06.863173 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_data.bdfcb49be6, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec)
[0m08:23:06.863173 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m08:23:06.869231 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m08:23:06.869231 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m08:23:06.874742 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m08:23:06.875752 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m08:23:06.876265 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: BEGIN
[0m08:23:06.876265 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.877813 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.879334 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"
[0m08:23:06.879334 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_totais"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.880405 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.880917 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: ROLLBACK
[0m08:23:06.882433 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec'
[0m08:23:06.883486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec: Close
[0m08:23:06.885052 [info ] [Thread-1 (]: 43 of 100 PASS not_null_fato_carteira_credito_totais_id_instituicao ............ [[32mPASS[0m in 0.02s]
[0m08:23:06.885761 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec
[0m08:23:06.886768 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m08:23:06.886768 [info ] [Thread-1 (]: 44 of 100 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:23:06.887400 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_totais_id_instituicao.d86e6398ec, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m08:23:06.888017 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m08:23:06.896203 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m08:23:06.898774 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m08:23:06.901021 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m08:23:06.903216 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m08:23:06.903801 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m08:23:06.903801 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.905535 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.905535 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m08:23:06.906663 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.910577 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:23:06.912087 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m08:23:06.913115 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m08:23:06.913115 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m08:23:06.914937 [info ] [Thread-1 (]: 44 of 100 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m08:23:06.916276 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m08:23:06.916889 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m08:23:06.917927 [info ] [Thread-1 (]: 45 of 100 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:23:06.919608 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m08:23:06.920242 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m08:23:06.927136 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m08:23:06.927136 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m08:23:06.930271 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m08:23:06.933434 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m08:23:06.934250 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m08:23:06.934250 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.935394 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.935394 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m08:23:06.935394 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.942300 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m08:23:06.942300 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m08:23:06.944004 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m08:23:06.945082 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m08:23:06.945082 [info ] [Thread-1 (]: 45 of 100 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m08:23:06.947452 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m08:23:06.948485 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m08:23:06.949026 [info ] [Thread-1 (]: 46 of 100 START test not_null_fato_demonstracao_resultado_id_data .............. [RUN]
[0m08:23:06.949539 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m08:23:06.950055 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m08:23:06.953792 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m08:23:06.955456 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m08:23:06.960510 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m08:23:06.963346 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m08:23:06.963346 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m08:23:06.964354 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.964861 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.965387 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m08:23:06.966398 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.967922 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.969525 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m08:23:06.970636 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m08:23:06.970636 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m08:23:06.970636 [info ] [Thread-1 (]: 46 of 100 PASS not_null_fato_demonstracao_resultado_id_data .................... [[32mPASS[0m in 0.02s]
[0m08:23:06.972348 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m08:23:06.972348 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m08:23:06.972348 [info ] [Thread-1 (]: 47 of 100 START test not_null_fato_demonstracao_resultado_id_instituicao ....... [RUN]
[0m08:23:06.973898 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m08:23:06.975144 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m08:23:06.982507 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m08:23:06.984561 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m08:23:06.987613 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m08:23:06.988727 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m08:23:06.988727 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m08:23:06.988727 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:06.990290 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.991819 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m08:23:06.992347 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:06.993867 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:06.996590 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m08:23:06.998987 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m08:23:07.000322 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m08:23:07.000917 [info ] [Thread-1 (]: 47 of 100 PASS not_null_fato_demonstracao_resultado_id_instituicao ............. [[32mPASS[0m in 0.03s]
[0m08:23:07.002071 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m08:23:07.003613 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m08:23:07.004260 [info ] [Thread-1 (]: 48 of 100 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:23:07.004260 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m08:23:07.005264 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m08:23:07.014786 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m08:23:07.017015 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m08:23:07.019232 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m08:23:07.020857 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m08:23:07.022392 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m08:23:07.022392 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.024483 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.025513 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m08:23:07.025513 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.034335 [debug] [Thread-1 (]: SQL status: OK in 0.007 seconds
[0m08:23:07.035568 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m08:23:07.038177 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m08:23:07.038952 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m08:23:07.039493 [info ] [Thread-1 (]: 48 of 100 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.04s]
[0m08:23:07.041397 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m08:23:07.043164 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m08:23:07.043164 [info ] [Thread-1 (]: 49 of 100 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:23:07.045356 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m08:23:07.045894 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m08:23:07.055055 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m08:23:07.056679 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m08:23:07.058347 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m08:23:07.061226 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m08:23:07.061226 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m08:23:07.062921 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.064626 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.065230 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m08:23:07.065230 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.074381 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m08:23:07.077438 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m08:23:07.079661 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m08:23:07.080281 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m08:23:07.081298 [info ] [Thread-1 (]: 49 of 100 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.04s]
[0m08:23:07.082521 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m08:23:07.082521 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m08:23:07.083788 [info ] [Thread-1 (]: 50 of 100 START test not_null_fato_movimentacao_cambio_id_data ................. [RUN]
[0m08:23:07.084306 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962)
[0m08:23:07.084306 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m08:23:07.090484 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m08:23:07.092052 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m08:23:07.096270 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m08:23:07.098337 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m08:23:07.098337 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: BEGIN
[0m08:23:07.098841 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.098841 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:07.098841 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"
[0m08:23:07.098841 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.100630 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:07.101828 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: ROLLBACK
[0m08:23:07.104705 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962'
[0m08:23:07.105349 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962: Close
[0m08:23:07.105998 [info ] [Thread-1 (]: 50 of 100 PASS not_null_fato_movimentacao_cambio_id_data ....................... [[32mPASS[0m in 0.02s]
[0m08:23:07.107554 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962
[0m08:23:07.107554 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m08:23:07.107554 [info ] [Thread-1 (]: 51 of 100 START test not_null_fato_movimentacao_cambio_id_instituicao .......... [RUN]
[0m08:23:07.109248 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_data.fa68311962, now test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070)
[0m08:23:07.109869 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m08:23:07.114398 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m08:23:07.116487 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m08:23:07.120768 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m08:23:07.122468 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m08:23:07.124044 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: BEGIN
[0m08:23:07.125097 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.125629 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.125629 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"
[0m08:23:07.126259 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_movimentacao_cambio"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.128255 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.128255 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: ROLLBACK
[0m08:23:07.129796 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070'
[0m08:23:07.129796 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070: Close
[0m08:23:07.129796 [info ] [Thread-1 (]: 51 of 100 PASS not_null_fato_movimentacao_cambio_id_instituicao ................ [[32mPASS[0m in 0.02s]
[0m08:23:07.132141 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070
[0m08:23:07.132650 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m08:23:07.132650 [info ] [Thread-1 (]: 52 of 100 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:23:07.133160 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_movimentacao_cambio_id_instituicao.c0baed0070, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m08:23:07.133160 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m08:23:07.140011 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m08:23:07.142061 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m08:23:07.145141 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m08:23:07.146994 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m08:23:07.146994 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m08:23:07.146994 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.149339 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.150291 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m08:23:07.151031 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.153653 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:07.156584 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m08:23:07.158220 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m08:23:07.159380 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m08:23:07.160011 [info ] [Thread-1 (]: 52 of 100 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m08:23:07.161027 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m08:23:07.161027 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m08:23:07.161027 [info ] [Thread-1 (]: 53 of 100 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:23:07.162987 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m08:23:07.162987 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m08:23:07.168897 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m08:23:07.170996 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m08:23:07.173530 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m08:23:07.176898 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m08:23:07.176898 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m08:23:07.177521 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.177521 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:07.177521 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m08:23:07.179292 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.183583 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:07.185785 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m08:23:07.187889 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m08:23:07.188679 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m08:23:07.189219 [info ] [Thread-1 (]: 53 of 100 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m08:23:07.191300 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m08:23:07.192311 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m08:23:07.192816 [info ] [Thread-1 (]: 54 of 100 START test not_null_fato_operacoes_clientes_id_data .................. [RUN]
[0m08:23:07.193321 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21)
[0m08:23:07.193321 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m08:23:07.198635 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m08:23:07.201916 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m08:23:07.205550 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m08:23:07.207682 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m08:23:07.208196 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: BEGIN
[0m08:23:07.208196 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.208196 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:07.209209 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"
[0m08:23:07.209716 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.209716 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.211271 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: ROLLBACK
[0m08:23:07.213397 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21'
[0m08:23:07.214651 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21: Close
[0m08:23:07.215764 [info ] [Thread-1 (]: 54 of 100 PASS not_null_fato_operacoes_clientes_id_data ........................ [[32mPASS[0m in 0.02s]
[0m08:23:07.217290 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21
[0m08:23:07.217798 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m08:23:07.217798 [info ] [Thread-1 (]: 55 of 100 START test not_null_fato_operacoes_clientes_id_instituicao ........... [RUN]
[0m08:23:07.218303 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_data.efb68a7b21, now test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004)
[0m08:23:07.218815 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m08:23:07.223308 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m08:23:07.225387 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m08:23:07.228210 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m08:23:07.229230 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m08:23:07.229879 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: BEGIN
[0m08:23:07.229879 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.230907 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.230907 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"
[0m08:23:07.231412 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_operacoes_clientes"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.232041 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:07.233144 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: ROLLBACK
[0m08:23:07.234332 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004'
[0m08:23:07.234332 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004: Close
[0m08:23:07.235820 [info ] [Thread-1 (]: 55 of 100 PASS not_null_fato_operacoes_clientes_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m08:23:07.235820 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004
[0m08:23:07.235820 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m08:23:07.235820 [info ] [Thread-1 (]: 56 of 100 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:23:07.238209 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_operacoes_clientes_id_instituicao.805731e004, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m08:23:07.238209 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m08:23:07.247041 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m08:23:07.249927 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m08:23:07.254038 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m08:23:07.255783 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m08:23:07.256898 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m08:23:07.256898 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.258556 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.258556 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m08:23:07.258556 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.262118 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:07.264462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m08:23:07.266184 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m08:23:07.266874 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m08:23:07.267990 [info ] [Thread-1 (]: 56 of 100 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m08:23:07.269931 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m08:23:07.269931 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m08:23:07.270559 [info ] [Thread-1 (]: 57 of 100 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:23:07.271173 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m08:23:07.271173 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m08:23:07.276203 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m08:23:07.277994 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m08:23:07.279563 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m08:23:07.282743 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m08:23:07.282743 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m08:23:07.283248 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.283912 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.283912 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m08:23:07.284428 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.289089 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m08:23:07.291343 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m08:23:07.292464 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m08:23:07.294002 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m08:23:07.295127 [info ] [Thread-1 (]: 57 of 100 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:23:07.296946 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m08:23:07.296946 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m08:23:07.297526 [info ] [Thread-1 (]: 58 of 100 START test not_null_fato_resumo_financeiro_id_data ................... [RUN]
[0m08:23:07.297526 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m08:23:07.297526 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m08:23:07.304538 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m08:23:07.306090 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m08:23:07.309937 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m08:23:07.312076 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m08:23:07.312586 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m08:23:07.312586 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.313612 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.314123 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m08:23:07.314651 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.316163 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.317211 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m08:23:07.318831 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m08:23:07.318831 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m08:23:07.320442 [info ] [Thread-1 (]: 58 of 100 PASS not_null_fato_resumo_financeiro_id_data ......................... [[32mPASS[0m in 0.02s]
[0m08:23:07.320954 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m08:23:07.320954 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m08:23:07.321963 [info ] [Thread-1 (]: 59 of 100 START test not_null_fato_resumo_financeiro_id_instituicao ............ [RUN]
[0m08:23:07.322467 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m08:23:07.322976 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m08:23:07.326708 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m08:23:07.328298 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m08:23:07.329814 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m08:23:07.331537 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m08:23:07.332094 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m08:23:07.332603 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.333115 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:07.333115 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m08:23:07.333656 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.334208 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:07.335347 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m08:23:07.337496 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m08:23:07.337496 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m08:23:07.338824 [info ] [Thread-1 (]: 59 of 100 PASS not_null_fato_resumo_financeiro_id_instituicao .................. [[32mPASS[0m in 0.02s]
[0m08:23:07.340954 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m08:23:07.340954 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m08:23:07.340954 [info ] [Thread-1 (]: 60 of 100 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:23:07.341962 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m08:23:07.341962 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m08:23:07.346770 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m08:23:07.348497 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m08:23:07.353536 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m08:23:07.356661 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m08:23:07.356661 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m08:23:07.356661 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.358326 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.358326 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m08:23:07.358326 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.361201 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:07.363353 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
[0m08:23:07.364369 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff'
[0m08:23:07.364369 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: Close
[0m08:23:07.367265 [info ] [Thread-1 (]: 60 of 100 PASS relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m08:23:07.367782 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m08:23:07.368791 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m08:23:07.369299 [info ] [Thread-1 (]: 61 of 100 START test relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:23:07.369299 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a)
[0m08:23:07.370427 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m08:23:07.375884 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m08:23:07.376891 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m08:23:07.380592 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m08:23:07.381644 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m08:23:07.381644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: BEGIN
[0m08:23:07.382152 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.383229 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.383793 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"
[0m08:23:07.384439 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:07.393070 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m08:23:07.394851 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: ROLLBACK
[0m08:23:07.396978 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a'
[0m08:23:07.396978 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a: Close
[0m08:23:07.398503 [info ] [Thread-1 (]: 61 of 100 PASS relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.03s]
[0m08:23:07.399544 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a
[0m08:23:07.399544 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_atividade
[0m08:23:07.400553 [info ] [Thread-1 (]: 62 of 100 START sql table model main.dim_atividade ............................. [RUN]
[0m08:23:07.401058 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_instituicao__id_instituicao__ref_dim_instituicao_.277d6a556a, now model.bacen_ifdata_analytics.dim_atividade)
[0m08:23:07.401581 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_atividade
[0m08:23:07.407017 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_atividade"
[0m08:23:07.408022 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_atividade
[0m08:23:07.414434 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_atividade"
[0m08:23:07.416663 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m08:23:07.417680 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: BEGIN
[0m08:23:07.417680 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:07.418700 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.419275 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m08:23:07.419275 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_atividade__dbt_tmp"
  
    as (
      

SELECT 
    id_atividade,
    nome_atividade,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_atividade"
    );
  
  
[0m08:23:07.419275 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.424080 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m08:23:07.424589 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */
alter table "gold_warehouse"."main"."dim_atividade__dbt_tmp" rename to "dim_atividade"
[0m08:23:07.426107 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.428750 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m08:23:07.429303 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m08:23:07.429303 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: COMMIT
[0m08:23:07.431085 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.435503 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_atividade"
[0m08:23:07.436533 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_atividade"} */

      drop table if exists "gold_warehouse"."main"."dim_atividade__dbt_backup" cascade
    
[0m08:23:07.437762 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:07.438988 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_atividade: Close
[0m08:23:07.439540 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938772A50>]}
[0m08:23:08.266014 [debug] [Thread-1 (]: An error was encountered while trying to send an event
[0m08:23:08.268056 [info ] [Thread-1 (]: 62 of 100 OK created sql table model main.dim_atividade ........................ [[32mOK[0m in 0.04s]
[0m08:23:08.269199 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_atividade
[0m08:23:08.269797 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m08:23:08.269797 [info ] [Thread-1 (]: 63 of 100 START sql table model main.dim_classe_instituicao .................... [RUN]
[0m08:23:08.271321 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_atividade, now model.bacen_ifdata_analytics.dim_classe_instituicao)
[0m08:23:08.272329 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m08:23:08.276313 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m08:23:08.277429 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m08:23:08.281745 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m08:23:08.283373 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m08:23:08.283373 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: BEGIN
[0m08:23:08.284037 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.284571 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.284571 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m08:23:08.285594 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_classe,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_classe_instituicao"
    );
  
  
[0m08:23:08.290042 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:23:08.296596 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m08:23:08.297128 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */
alter table "gold_warehouse"."main"."dim_classe_instituicao__dbt_tmp" rename to "dim_classe_instituicao"
[0m08:23:08.297128 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.299553 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m08:23:08.299553 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m08:23:08.299553 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: COMMIT
[0m08:23:08.301813 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.303838 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_classe_instituicao"
[0m08:23:08.303838 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_classe_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_classe_instituicao__dbt_backup" cascade
    
[0m08:23:08.305562 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.308125 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_classe_instituicao: Close
[0m08:23:08.308125 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209381A3CB0>]}
[0m08:23:08.309634 [info ] [Thread-1 (]: 63 of 100 OK created sql table model main.dim_classe_instituicao ............... [[32mOK[0m in 0.04s]
[0m08:23:08.309634 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_classe_instituicao
[0m08:23:08.310431 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_consolidado
[0m08:23:08.310431 [info ] [Thread-1 (]: 64 of 100 START sql table model main.dim_consolidado ........................... [RUN]
[0m08:23:08.311068 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_classe_instituicao, now model.bacen_ifdata_analytics.dim_consolidado)
[0m08:23:08.311068 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_consolidado
[0m08:23:08.314823 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m08:23:08.315971 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_consolidado
[0m08:23:08.319191 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_consolidado"
[0m08:23:08.321919 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m08:23:08.321919 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: BEGIN
[0m08:23:08.321919 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.321919 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.323592 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m08:23:08.323592 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_consolidado__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_consolidado,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_consolidado"
    );
  
  
[0m08:23:08.325121 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.326660 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m08:23:08.328166 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */
alter table "gold_warehouse"."main"."dim_consolidado__dbt_tmp" rename to "dim_consolidado"
[0m08:23:08.329197 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.330935 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m08:23:08.330935 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m08:23:08.331462 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: COMMIT
[0m08:23:08.333011 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.336678 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_consolidado"
[0m08:23:08.336678 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_consolidado"} */

      drop table if exists "gold_warehouse"."main"."dim_consolidado__dbt_backup" cascade
    
[0m08:23:08.336678 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.338180 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_consolidado: Close
[0m08:23:08.338704 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209381E0590>]}
[0m08:23:08.339734 [info ] [Thread-1 (]: 64 of 100 OK created sql table model main.dim_consolidado ...................... [[32mOK[0m in 0.03s]
[0m08:23:08.341248 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_consolidado
[0m08:23:08.341248 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_controle
[0m08:23:08.342255 [info ] [Thread-1 (]: 65 of 100 START sql table model main.dim_controle .............................. [RUN]
[0m08:23:08.342255 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_consolidado, now model.bacen_ifdata_analytics.dim_controle)
[0m08:23:08.343424 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_controle
[0m08:23:08.347460 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_controle"
[0m08:23:08.348499 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_controle
[0m08:23:08.352924 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_controle"
[0m08:23:08.353923 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m08:23:08.355611 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: BEGIN
[0m08:23:08.356640 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.357622 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.357622 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m08:23:08.357622 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_controle__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_controle,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_controle"
    );
  
  
[0m08:23:08.359125 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.361707 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m08:23:08.363949 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */
alter table "gold_warehouse"."main"."dim_controle__dbt_tmp" rename to "dim_controle"
[0m08:23:08.364458 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.365464 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m08:23:08.365464 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m08:23:08.366582 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: COMMIT
[0m08:23:08.367603 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.375037 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_controle"
[0m08:23:08.375558 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_controle"} */

      drop table if exists "gold_warehouse"."main"."dim_controle__dbt_backup" cascade
    
[0m08:23:08.376573 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.378585 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_controle: Close
[0m08:23:08.379814 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209582B2000>]}
[0m08:23:08.380381 [info ] [Thread-1 (]: 65 of 100 OK created sql table model main.dim_controle ......................... [[32mOK[0m in 0.04s]
[0m08:23:08.380908 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_controle
[0m08:23:08.380908 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m08:23:08.381913 [info ] [Thread-1 (]: 66 of 100 START sql table model main.dim_faixa_vencimento ...................... [RUN]
[0m08:23:08.381913 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_controle, now model.bacen_ifdata_analytics.dim_faixa_vencimento)
[0m08:23:08.381913 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m08:23:08.386604 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m08:23:08.388091 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m08:23:08.390194 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m08:23:08.392236 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m08:23:08.392236 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: BEGIN
[0m08:23:08.392236 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.393242 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.393242 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m08:23:08.393242 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp"
  
    as (
      

SELECT 
    id_faixa,
    nome_faixa,
    ordem,
    sufixo_coluna
FROM "gold_warehouse"."main"."seed_dim_faixa_vencimento"
    );
  
  
[0m08:23:08.395669 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.398778 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m08:23:08.399469 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */
alter table "gold_warehouse"."main"."dim_faixa_vencimento__dbt_tmp" rename to "dim_faixa_vencimento"
[0m08:23:08.400474 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.401693 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m08:23:08.402726 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m08:23:08.402726 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: COMMIT
[0m08:23:08.404218 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.406773 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_faixa_vencimento"
[0m08:23:08.406773 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_faixa_vencimento"} */

      drop table if exists "gold_warehouse"."main"."dim_faixa_vencimento__dbt_backup" cascade
    
[0m08:23:08.407772 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.408771 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_faixa_vencimento: Close
[0m08:23:08.409757 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002093819B200>]}
[0m08:23:08.410768 [info ] [Thread-1 (]: 66 of 100 OK created sql table model main.dim_faixa_vencimento ................. [[32mOK[0m in 0.03s]
[0m08:23:08.411311 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_faixa_vencimento
[0m08:23:08.411311 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_porte
[0m08:23:08.412322 [info ] [Thread-1 (]: 67 of 100 START sql table model main.dim_porte ................................. [RUN]
[0m08:23:08.413319 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_faixa_vencimento, now model.bacen_ifdata_analytics.dim_porte)
[0m08:23:08.413319 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_porte
[0m08:23:08.415751 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_porte"
[0m08:23:08.417018 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_porte
[0m08:23:08.420767 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_porte"
[0m08:23:08.421920 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m08:23:08.421920 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: BEGIN
[0m08:23:08.421920 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.423592 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.424140 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m08:23:08.424140 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_porte__dbt_tmp"
  
    as (
      

SELECT 
    id_porte,
    nome_porte,
    coluna
FROM "gold_warehouse"."main"."seed_dim_porte"
    );
  
  
[0m08:23:08.425270 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.428073 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m08:23:08.428073 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */
alter table "gold_warehouse"."main"."dim_porte__dbt_tmp" rename to "dim_porte"
[0m08:23:08.429070 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.430741 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m08:23:08.431347 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m08:23:08.431347 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: COMMIT
[0m08:23:08.431971 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.434506 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_porte"
[0m08:23:08.434506 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_porte"} */

      drop table if exists "gold_warehouse"."main"."dim_porte__dbt_backup" cascade
    
[0m08:23:08.435618 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.436795 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_porte: Close
[0m08:23:08.436795 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020937E7D940>]}
[0m08:23:08.437798 [info ] [Thread-1 (]: 67 of 100 OK created sql table model main.dim_porte ............................ [[32mOK[0m in 0.02s]
[0m08:23:08.438303 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_porte
[0m08:23:08.438303 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_produto_credito
[0m08:23:08.439459 [info ] [Thread-1 (]: 68 of 100 START sql table model main.dim_produto_credito ....................... [RUN]
[0m08:23:08.439459 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_porte, now model.bacen_ifdata_analytics.dim_produto_credito)
[0m08:23:08.439459 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_produto_credito
[0m08:23:08.444956 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m08:23:08.446527 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_produto_credito
[0m08:23:08.449399 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_produto_credito"
[0m08:23:08.451140 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m08:23:08.451140 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: BEGIN
[0m08:23:08.451728 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.451728 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.452736 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m08:23:08.452736 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_produto_credito__dbt_tmp"
  
    as (
      

SELECT 
    id_produto,
    nome_produto,
    tipo_pessoa,
    prefixo_coluna
FROM "gold_warehouse"."main"."seed_dim_produto_credito"
    );
  
  
[0m08:23:08.453744 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.455409 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m08:23:08.456537 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */
alter table "gold_warehouse"."main"."dim_produto_credito__dbt_tmp" rename to "dim_produto_credito"
[0m08:23:08.457460 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.458434 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m08:23:08.459089 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m08:23:08.459089 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: COMMIT
[0m08:23:08.460095 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.461728 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_produto_credito"
[0m08:23:08.461728 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_produto_credito"} */

      drop table if exists "gold_warehouse"."main"."dim_produto_credito__dbt_backup" cascade
    
[0m08:23:08.463349 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.464356 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_produto_credito: Close
[0m08:23:08.464861 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020937E7E570>]}
[0m08:23:08.465363 [info ] [Thread-1 (]: 68 of 100 OK created sql table model main.dim_produto_credito .................. [[32mOK[0m in 0.02s]
[0m08:23:08.466372 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_produto_credito
[0m08:23:08.466878 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_regiao
[0m08:23:08.466878 [info ] [Thread-1 (]: 69 of 100 START sql table model main.dim_regiao ................................ [RUN]
[0m08:23:08.467887 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_produto_credito, now model.bacen_ifdata_analytics.dim_regiao)
[0m08:23:08.467887 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_regiao
[0m08:23:08.470607 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_regiao"
[0m08:23:08.472213 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_regiao
[0m08:23:08.476673 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_regiao"
[0m08:23:08.477669 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m08:23:08.479177 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: BEGIN
[0m08:23:08.479757 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.479757 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.479757 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m08:23:08.479757 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_regiao__dbt_tmp"
  
    as (
      

SELECT 
    id_regiao,
    nome_regiao,
    coluna
FROM "gold_warehouse"."main"."seed_dim_regiao"
    );
  
  
[0m08:23:08.481991 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.485735 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m08:23:08.486847 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */
alter table "gold_warehouse"."main"."dim_regiao__dbt_tmp" rename to "dim_regiao"
[0m08:23:08.488446 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.488446 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m08:23:08.489565 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m08:23:08.490182 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: COMMIT
[0m08:23:08.491344 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.492613 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_regiao"
[0m08:23:08.493896 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_regiao"} */

      drop table if exists "gold_warehouse"."main"."dim_regiao__dbt_backup" cascade
    
[0m08:23:08.495066 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.496090 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_regiao: Close
[0m08:23:08.496090 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002093819A330>]}
[0m08:23:08.497177 [info ] [Thread-1 (]: 69 of 100 OK created sql table model main.dim_regiao ........................... [[32mOK[0m in 0.03s]
[0m08:23:08.497177 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_regiao
[0m08:23:08.498723 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_risco
[0m08:23:08.499407 [info ] [Thread-1 (]: 70 of 100 START sql table model main.dim_risco ................................. [RUN]
[0m08:23:08.499407 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_regiao, now model.bacen_ifdata_analytics.dim_risco)
[0m08:23:08.501070 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_risco
[0m08:23:08.506023 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_risco"
[0m08:23:08.506951 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_risco
[0m08:23:08.512293 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_risco"
[0m08:23:08.514306 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m08:23:08.514306 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: BEGIN
[0m08:23:08.514306 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.515832 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.516936 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m08:23:08.516936 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_risco__dbt_tmp"
  
    as (
      

SELECT 
    id_risco,
    nome_risco,
    coluna
FROM "gold_warehouse"."main"."seed_dim_risco"
    );
  
  
[0m08:23:08.517545 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.522104 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m08:23:08.522104 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */
alter table "gold_warehouse"."main"."dim_risco__dbt_tmp" rename to "dim_risco"
[0m08:23:08.522104 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.524475 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m08:23:08.525149 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m08:23:08.525149 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: COMMIT
[0m08:23:08.527680 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.529882 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_risco"
[0m08:23:08.529882 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_risco"} */

      drop table if exists "gold_warehouse"."main"."dim_risco__dbt_backup" cascade
    
[0m08:23:08.531611 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.532735 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_risco: Close
[0m08:23:08.533345 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020958309A90>]}
[0m08:23:08.533998 [info ] [Thread-1 (]: 70 of 100 OK created sql table model main.dim_risco ............................ [[32mOK[0m in 0.03s]
[0m08:23:08.535032 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_risco
[0m08:23:08.535831 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_segmento
[0m08:23:08.536352 [info ] [Thread-1 (]: 71 of 100 START sql table model main.dim_segmento .............................. [RUN]
[0m08:23:08.536932 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_risco, now model.bacen_ifdata_analytics.dim_segmento)
[0m08:23:08.536932 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_segmento
[0m08:23:08.539847 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_segmento"
[0m08:23:08.541378 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_segmento
[0m08:23:08.544513 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_segmento"
[0m08:23:08.544513 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m08:23:08.546276 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: BEGIN
[0m08:23:08.546793 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.547159 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.547662 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m08:23:08.547662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_segmento__dbt_tmp"
  
    as (
      

SELECT 
    md5(cast(codigo as varchar)) as id_segmento,
    codigo,
    descricao
FROM "gold_warehouse"."main"."seed_dim_segmento"
    );
  
  
[0m08:23:08.549188 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.552003 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m08:23:08.552723 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */
alter table "gold_warehouse"."main"."dim_segmento__dbt_tmp" rename to "dim_segmento"
[0m08:23:08.552723 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.553726 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m08:23:08.554826 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m08:23:08.555355 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: COMMIT
[0m08:23:08.556905 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.558932 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_segmento"
[0m08:23:08.559932 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_segmento"} */

      drop table if exists "gold_warehouse"."main"."dim_segmento__dbt_backup" cascade
    
[0m08:23:08.559932 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.560521 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_segmento: Close
[0m08:23:08.561524 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002093813D910>]}
[0m08:23:08.561524 [info ] [Thread-1 (]: 71 of 100 OK created sql table model main.dim_segmento ......................... [[32mOK[0m in 0.02s]
[0m08:23:08.563338 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_segmento
[0m08:23:08.563338 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m08:23:08.564866 [info ] [Thread-1 (]: 72 of 100 START test not_null_dim_classe_instituicao_id_classe ................. [RUN]
[0m08:23:08.565468 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267)
[0m08:23:08.565468 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m08:23:08.568766 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m08:23:08.569372 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m08:23:08.573011 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m08:23:08.574672 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m08:23:08.574672 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: BEGIN
[0m08:23:08.574672 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.576185 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.576185 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"
[0m08:23:08.576185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_classe
from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is null



  
  
      
    ) dbt_internal_test
[0m08:23:08.576185 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.577692 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: ROLLBACK
[0m08:23:08.579920 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267'
[0m08:23:08.579920 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267: Close
[0m08:23:08.580944 [info ] [Thread-1 (]: 72 of 100 PASS not_null_dim_classe_instituicao_id_classe ....................... [[32mPASS[0m in 0.02s]
[0m08:23:08.581988 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267
[0m08:23:08.582611 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m08:23:08.583147 [info ] [Thread-1 (]: 73 of 100 START test relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [RUN]
[0m08:23:08.583147 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_classe_instituicao_id_classe.526dd4f267, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0)
[0m08:23:08.583798 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m08:23:08.591236 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m08:23:08.592351 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m08:23:08.595275 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m08:23:08.595275 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m08:23:08.597518 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: BEGIN
[0m08:23:08.598125 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.598742 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.598742 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"
[0m08:23:08.599300 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_classe as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_classe is not null
),

parent as (
    select id_classe as to_field
    from "gold_warehouse"."main"."dim_classe_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:08.601070 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:08.602743 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: ROLLBACK
[0m08:23:08.603741 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0'
[0m08:23:08.603741 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0: Close
[0m08:23:08.603741 [info ] [Thread-1 (]: 73 of 100 PASS relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:23:08.605460 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0
[0m08:23:08.605460 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m08:23:08.606534 [info ] [Thread-1 (]: 74 of 100 START test unique_dim_classe_instituicao_id_classe ................... [RUN]
[0m08:23:08.606534 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_classe__id_classe__ref_dim_classe_instituicao_.381d3aa6e0, now test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19)
[0m08:23:08.606534 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m08:23:08.611768 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m08:23:08.613897 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m08:23:08.615570 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m08:23:08.617393 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m08:23:08.617393 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: BEGIN
[0m08:23:08.617393 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.617393 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.618913 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"
[0m08:23:08.619944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_classe as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_classe_instituicao"
where id_classe is not null
group by id_classe
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:23:08.622201 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:08.623625 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: ROLLBACK
[0m08:23:08.625634 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19'
[0m08:23:08.625634 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19: Close
[0m08:23:08.626745 [info ] [Thread-1 (]: 74 of 100 PASS unique_dim_classe_instituicao_id_classe ......................... [[32mPASS[0m in 0.02s]
[0m08:23:08.627704 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19
[0m08:23:08.629213 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m08:23:08.629213 [info ] [Thread-1 (]: 75 of 100 START test not_null_dim_consolidado_id_consolidado ................... [RUN]
[0m08:23:08.629831 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_classe_instituicao_id_classe.c95c4dcb19, now test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340)
[0m08:23:08.630366 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m08:23:08.635531 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m08:23:08.637853 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m08:23:08.640303 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m08:23:08.641413 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m08:23:08.642942 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: BEGIN
[0m08:23:08.643451 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.643909 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.643909 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"
[0m08:23:08.643909 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_consolidado
from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is null



  
  
      
    ) dbt_internal_test
[0m08:23:08.646004 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.647074 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: ROLLBACK
[0m08:23:08.647606 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340'
[0m08:23:08.647606 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340: Close
[0m08:23:08.649196 [info ] [Thread-1 (]: 75 of 100 PASS not_null_dim_consolidado_id_consolidado ......................... [[32mPASS[0m in 0.02s]
[0m08:23:08.649989 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340
[0m08:23:08.650497 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m08:23:08.651554 [info ] [Thread-1 (]: 76 of 100 START test relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [RUN]
[0m08:23:08.652561 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_consolidado_id_consolidado.942629b340, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e)
[0m08:23:08.652561 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m08:23:08.657251 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m08:23:08.658248 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m08:23:08.663751 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m08:23:08.665821 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m08:23:08.666372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: BEGIN
[0m08:23:08.666931 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.667938 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.668941 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"
[0m08:23:08.668941 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_consolidado as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_consolidado is not null
),

parent as (
    select id_consolidado as to_field
    from "gold_warehouse"."main"."dim_consolidado"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:08.671880 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:23:08.675484 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: ROLLBACK
[0m08:23:08.677085 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e'
[0m08:23:08.678084 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e: Close
[0m08:23:08.679086 [info ] [Thread-1 (]: 76 of 100 PASS relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_  [[32mPASS[0m in 0.03s]
[0m08:23:08.679590 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e
[0m08:23:08.679590 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m08:23:08.679590 [info ] [Thread-1 (]: 77 of 100 START test unique_dim_consolidado_id_consolidado ..................... [RUN]
[0m08:23:08.681143 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_consolidado__id_consolidado__ref_dim_consolidado_.2ca81db67e, now test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862)
[0m08:23:08.681679 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m08:23:08.686326 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m08:23:08.686326 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m08:23:08.689752 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m08:23:08.691261 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m08:23:08.691261 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: BEGIN
[0m08:23:08.692272 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.692272 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.693313 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"
[0m08:23:08.693313 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_consolidado as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_consolidado"
where id_consolidado is not null
group by id_consolidado
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:23:08.694945 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.696101 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: ROLLBACK
[0m08:23:08.696728 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862'
[0m08:23:08.696728 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862: Close
[0m08:23:08.697397 [info ] [Thread-1 (]: 77 of 100 PASS unique_dim_consolidado_id_consolidado ........................... [[32mPASS[0m in 0.02s]
[0m08:23:08.697397 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862
[0m08:23:08.698452 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m08:23:08.699060 [info ] [Thread-1 (]: 78 of 100 START test not_null_dim_controle_id_controle ......................... [RUN]
[0m08:23:08.699060 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_consolidado_id_consolidado.297d579862, now test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21)
[0m08:23:08.699632 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m08:23:08.703899 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m08:23:08.704456 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m08:23:08.705582 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m08:23:08.707097 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m08:23:08.707097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: BEGIN
[0m08:23:08.707791 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.707791 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.707791 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"
[0m08:23:08.708904 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_controle
from "gold_warehouse"."main"."dim_controle"
where id_controle is null



  
  
      
    ) dbt_internal_test
[0m08:23:08.708904 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.710384 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: ROLLBACK
[0m08:23:08.710992 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21'
[0m08:23:08.710992 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21: Close
[0m08:23:08.712021 [info ] [Thread-1 (]: 78 of 100 PASS not_null_dim_controle_id_controle ............................... [[32mPASS[0m in 0.01s]
[0m08:23:08.712021 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21
[0m08:23:08.712021 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m08:23:08.713007 [info ] [Thread-1 (]: 79 of 100 START test relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [RUN]
[0m08:23:08.713513 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_controle_id_controle.10a8c0fa21, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f)
[0m08:23:08.713513 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m08:23:08.716632 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m08:23:08.717666 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m08:23:08.718900 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m08:23:08.719929 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m08:23:08.719929 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: BEGIN
[0m08:23:08.719929 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.720928 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:08.720928 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"
[0m08:23:08.720928 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_controle as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_controle is not null
),

parent as (
    select id_controle as to_field
    from "gold_warehouse"."main"."dim_controle"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:08.723098 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.723602 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: ROLLBACK
[0m08:23:08.725194 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f'
[0m08:23:08.725194 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f: Close
[0m08:23:08.725194 [info ] [Thread-1 (]: 79 of 100 PASS relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_  [[32mPASS[0m in 0.01s]
[0m08:23:08.726223 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f
[0m08:23:08.726223 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m08:23:08.726223 [info ] [Thread-1 (]: 80 of 100 START test unique_dim_controle_id_controle ........................... [RUN]
[0m08:23:08.727203 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_controle__id_controle__ref_dim_controle_.e308bf0f9f, now test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c)
[0m08:23:08.727203 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m08:23:08.733788 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m08:23:08.736323 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m08:23:08.741476 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m08:23:08.743536 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m08:23:08.743536 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: BEGIN
[0m08:23:08.745162 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.746678 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.747242 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"
[0m08:23:08.747242 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_controle as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_controle"
where id_controle is not null
group by id_controle
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:23:08.749383 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.752455 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: ROLLBACK
[0m08:23:08.752455 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c'
[0m08:23:08.754002 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c: Close
[0m08:23:08.754667 [info ] [Thread-1 (]: 80 of 100 PASS unique_dim_controle_id_controle ................................. [[32mPASS[0m in 0.03s]
[0m08:23:08.755187 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c
[0m08:23:08.755187 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m08:23:08.755909 [info ] [Thread-1 (]: 81 of 100 START sql table model main.fato_carteira_credito_atividade ........... [RUN]
[0m08:23:08.755909 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_controle_id_controle.b7e020982c, now model.bacen_ifdata_analytics.fato_carteira_credito_atividade)
[0m08:23:08.756920 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m08:23:08.760424 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m08:23:08.777295 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m08:23:08.781691 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m08:23:08.783788 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m08:23:08.783788 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: BEGIN
[0m08:23:08.785310 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:08.785845 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:08.786851 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m08:23:08.787358 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        a.id_atividade,
        f.id_faixa,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_atividade" a ON u.nome_coluna LIKE a.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_atividade as id_atividade_economica,
    id_faixa as id_faixa_vencimento,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m08:23:26.839810 [debug] [Thread-1 (]: SQL status: OK in 18.051 seconds
[0m08:23:26.857551 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m08:23:26.857551 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_tmp" rename to "fato_carteira_credito_atividade"
[0m08:23:26.859754 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:26.860793 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m08:23:26.860793 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m08:23:26.860793 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: COMMIT
[0m08:23:27.005273 [debug] [Thread-1 (]: SQL status: OK in 0.143 seconds
[0m08:23:27.011016 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"
[0m08:23:27.012568 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_atividade"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_atividade__dbt_backup" cascade
    
[0m08:23:27.013111 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:27.014653 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_atividade: Close
[0m08:23:27.016892 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020958342060>]}
[0m08:23:27.018483 [info ] [Thread-1 (]: 81 of 100 OK created sql table model main.fato_carteira_credito_atividade ...... [[32mOK[0m in 18.26s]
[0m08:23:27.019555 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_atividade
[0m08:23:27.020567 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m08:23:27.022076 [info ] [Thread-1 (]: 82 of 100 START sql table model main.fato_carteira_credito_porte ............... [RUN]
[0m08:23:27.023093 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_atividade, now model.bacen_ifdata_analytics.fato_carteira_credito_porte)
[0m08:23:27.023093 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m08:23:27.031854 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m08:23:27.033450 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m08:23:27.038972 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m08:23:27.041060 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m08:23:27.041060 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: BEGIN
[0m08:23:27.041597 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:27.042117 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:27.042117 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m08:23:27.043199 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_nao_individualizado_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_porte,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_porte" p ON u.nome_coluna = p.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_porte,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m08:23:27.217002 [debug] [Thread-1 (]: SQL status: OK in 0.175 seconds
[0m08:23:27.220661 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m08:23:27.221692 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_tmp" rename to "fato_carteira_credito_porte"
[0m08:23:27.222216 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:27.223246 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m08:23:27.223770 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m08:23:27.223770 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: COMMIT
[0m08:23:27.230859 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m08:23:27.233570 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_porte"
[0m08:23:27.233570 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_porte"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_porte__dbt_backup" cascade
    
[0m08:23:27.234720 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:27.236338 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_porte: Close
[0m08:23:27.236338 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209388567B0>]}
[0m08:23:27.237629 [info ] [Thread-1 (]: 82 of 100 OK created sql table model main.fato_carteira_credito_porte .......... [[32mOK[0m in 0.21s]
[0m08:23:27.238225 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_porte
[0m08:23:27.238736 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m08:23:27.238736 [info ] [Thread-1 (]: 83 of 100 START sql table model main.fato_carteira_credito_produto ............. [RUN]
[0m08:23:27.240297 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_porte, now model.bacen_ifdata_analytics.fato_carteira_credito_produto)
[0m08:23:27.240297 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m08:23:27.246174 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m08:23:27.247871 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m08:23:27.252468 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m08:23:27.254010 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m08:23:27.254010 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: BEGIN
[0m08:23:27.254010 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:27.255654 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:27.255654 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m08:23:27.257194 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp"
  
    as (
      

WITH unpivoted_pf AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_fisica, total_exterior_pessoa_fisica
            ))
        )
    )
),
pf_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pf u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PF', 'Ambos')
),
unpivoted_pj AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_carteira_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base,
                total_da_carteira_de_pessoa_juridica, total_exterior_pessoa_juridica
            ))
        )
    )
),
pj_mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        p.id_produto,
        f.id_faixa,
        u.valor
    FROM unpivoted_pj u
    JOIN "gold_warehouse"."main"."dim_produto_credito" p ON u.nome_coluna LIKE p.prefixo_coluna || '%'
    JOIN "gold_warehouse"."main"."dim_faixa_vencimento" f ON u.nome_coluna LIKE '%' || f.sufixo_coluna
    WHERE p.tipo_pessoa IN ('PJ', 'Ambos')
),
combined AS (
    SELECT * FROM pf_mapped
    UNION ALL
    SELECT * FROM pj_mapped
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(try_cast(data_base as date), '%Y%m%d')::int as id_data,
    id_produto,
    id_faixa as id_faixa_vencimento,
    valor
FROM combined
WHERE valor IS NOT NULL
    );
  
  
[0m08:23:40.205439 [debug] [Thread-1 (]: SQL status: OK in 12.948 seconds
[0m08:23:40.207463 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m08:23:40.207463 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */
alter table "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_tmp" rename to "fato_carteira_credito_produto"
[0m08:23:40.208462 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:40.209464 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m08:23:40.209464 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m08:23:40.209464 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: COMMIT
[0m08:23:40.239368 [debug] [Thread-1 (]: SQL status: OK in 0.029 seconds
[0m08:23:40.240896 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_carteira_credito_produto"
[0m08:23:40.240896 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_carteira_credito_produto"} */

      drop table if exists "gold_warehouse"."main"."fato_carteira_credito_produto__dbt_backup" cascade
    
[0m08:23:40.242569 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:40.243137 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_carteira_credito_produto: Close
[0m08:23:40.243137 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020958364170>]}
[0m08:23:40.243137 [info ] [Thread-1 (]: 83 of 100 OK created sql table model main.fato_carteira_credito_produto ........ [[32mOK[0m in 13.00s]
[0m08:23:40.244780 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_carteira_credito_produto
[0m08:23:40.244780 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m08:23:40.244780 [info ] [Thread-1 (]: 84 of 100 START sql table model main.fato_regiao_credito ....................... [RUN]
[0m08:23:40.246289 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_carteira_credito_produto, now model.bacen_ifdata_analytics.fato_regiao_credito)
[0m08:23:40.246289 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_regiao_credito
[0m08:23:40.250833 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m08:23:40.251356 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_regiao_credito
[0m08:23:40.253875 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m08:23:40.255562 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m08:23:40.255562 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: BEGIN
[0m08:23:40.255562 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.256595 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:40.257103 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m08:23:40.257103 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_regiao,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_regiao" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_regiao,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m08:23:40.460921 [debug] [Thread-1 (]: SQL status: OK in 0.204 seconds
[0m08:23:40.463646 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m08:23:40.463646 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */
alter table "gold_warehouse"."main"."fato_regiao_credito__dbt_tmp" rename to "fato_regiao_credito"
[0m08:23:40.464679 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:40.465694 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m08:23:40.465694 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m08:23:40.466272 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: COMMIT
[0m08:23:40.475230 [debug] [Thread-1 (]: SQL status: OK in 0.009 seconds
[0m08:23:40.477251 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_regiao_credito"
[0m08:23:40.477251 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_regiao_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_regiao_credito__dbt_backup" cascade
    
[0m08:23:40.478251 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:40.479252 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_regiao_credito: Close
[0m08:23:40.479252 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020938830CE0>]}
[0m08:23:40.479775 [info ] [Thread-1 (]: 84 of 100 OK created sql table model main.fato_regiao_credito .................. [[32mOK[0m in 0.23s]
[0m08:23:40.479775 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_regiao_credito
[0m08:23:40.479775 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_risco_credito
[0m08:23:40.481921 [info ] [Thread-1 (]: 85 of 100 START sql table model main.fato_risco_credito ........................ [RUN]
[0m08:23:40.482442 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_regiao_credito, now model.bacen_ifdata_analytics.fato_risco_credito)
[0m08:23:40.482442 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_risco_credito
[0m08:23:40.486234 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m08:23:40.488335 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_risco_credito
[0m08:23:40.490873 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_risco_credito"
[0m08:23:40.491877 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m08:23:40.492380 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: BEGIN
[0m08:23:40.492380 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.493382 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.493382 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m08:23:40.493382 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_risco_credito__dbt_tmp"
  
    as (
      

WITH unpivoted AS (
    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )

    UNION ALL

    SELECT 
        codigo, 
        data_base, 
        nome_coluna, 
        valor,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNPIVOT (
        valor FOR nome_coluna IN (
            COLUMNS(* EXCLUDE (
                instituicao, codigo, consolidado_bancario, tipo_de_consolidacao, tipo_de_controle,
                segmento_resolucao, segmento, cidade, uf, regiao, data_base, total_geral
            ))
        )
    )
),
mapped AS (
    SELECT
        u.codigo,
        u.data_base,
        u.tipo_instituicao,
        r.id_risco,
        u.valor
    FROM unpivoted u
    JOIN "gold_warehouse"."main"."dim_risco" r ON u.nome_coluna = r.coluna
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    strftime(data_base, '%Y%m%d')::int as id_data,
    id_risco as id_nivel_risco,
    valor
FROM mapped
WHERE valor IS NOT NULL
    );
  
  
[0m08:23:40.793665 [debug] [Thread-1 (]: SQL status: OK in 0.300 seconds
[0m08:23:40.796368 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m08:23:40.796368 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */
alter table "gold_warehouse"."main"."fato_risco_credito__dbt_tmp" rename to "fato_risco_credito"
[0m08:23:40.797155 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:40.797155 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m08:23:40.797155 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m08:23:40.797155 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: COMMIT
[0m08:23:40.836137 [debug] [Thread-1 (]: SQL status: OK in 0.038 seconds
[0m08:23:40.839306 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_risco_credito"
[0m08:23:40.839306 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_risco_credito"} */

      drop table if exists "gold_warehouse"."main"."fato_risco_credito__dbt_backup" cascade
    
[0m08:23:40.839306 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:40.840288 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_risco_credito: Close
[0m08:23:40.841304 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020937E6CAA0>]}
[0m08:23:40.841304 [info ] [Thread-1 (]: 85 of 100 OK created sql table model main.fato_risco_credito ................... [[32mOK[0m in 0.36s]
[0m08:23:40.842450 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_risco_credito
[0m08:23:40.842450 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m08:23:40.842450 [info ] [Thread-1 (]: 86 of 100 START test not_null_dim_segmento_id_segmento ......................... [RUN]
[0m08:23:40.843586 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_risco_credito, now test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e)
[0m08:23:40.843586 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m08:23:40.847095 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m08:23:40.849257 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m08:23:40.852352 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m08:23:40.852352 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m08:23:40.853859 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: BEGIN
[0m08:23:40.853859 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.853859 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.855479 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"
[0m08:23:40.855479 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_segmento
from "gold_warehouse"."main"."dim_segmento"
where id_segmento is null



  
  
      
    ) dbt_internal_test
[0m08:23:40.856506 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.857785 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: ROLLBACK
[0m08:23:40.859768 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e'
[0m08:23:40.859768 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e: Close
[0m08:23:40.860273 [info ] [Thread-1 (]: 86 of 100 PASS not_null_dim_segmento_id_segmento ............................... [[32mPASS[0m in 0.02s]
[0m08:23:40.861006 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e
[0m08:23:40.861006 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m08:23:40.861006 [info ] [Thread-1 (]: 87 of 100 START test relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [RUN]
[0m08:23:40.862009 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_segmento_id_segmento.6f9c02e79e, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e)
[0m08:23:40.862009 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m08:23:40.865545 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m08:23:40.868082 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m08:23:40.869095 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m08:23:40.871733 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m08:23:40.872239 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: BEGIN
[0m08:23:40.872239 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.872239 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:40.873244 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"
[0m08:23:40.873244 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_segmento as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_segmento is not null
),

parent as (
    select id_segmento as to_field
    from "gold_warehouse"."main"."dim_segmento"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:40.875376 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:40.876390 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: ROLLBACK
[0m08:23:40.877918 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e'
[0m08:23:40.877918 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e: Close
[0m08:23:40.877918 [info ] [Thread-1 (]: 87 of 100 PASS relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_  [[32mPASS[0m in 0.02s]
[0m08:23:40.879425 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e
[0m08:23:40.879985 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m08:23:40.879985 [info ] [Thread-1 (]: 88 of 100 START test unique_dim_segmento_id_segmento ........................... [RUN]
[0m08:23:40.879985 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_segmento__id_segmento__ref_dim_segmento_.d385c7766e, now test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a)
[0m08:23:40.881010 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m08:23:40.883219 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m08:23:40.885455 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m08:23:40.887495 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m08:23:40.888696 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m08:23:40.888696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: BEGIN
[0m08:23:40.888696 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.889703 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.890208 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"
[0m08:23:40.890208 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_segmento as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_segmento"
where id_segmento is not null
group by id_segmento
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:23:40.892217 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.893268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: ROLLBACK
[0m08:23:40.893268 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a'
[0m08:23:40.893268 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a: Close
[0m08:23:40.894946 [info ] [Thread-1 (]: 88 of 100 PASS unique_dim_segmento_id_segmento ................................. [[32mPASS[0m in 0.01s]
[0m08:23:40.894946 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a
[0m08:23:40.894946 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m08:23:40.896614 [info ] [Thread-1 (]: 89 of 100 START test not_null_fato_carteira_credito_atividade_id_instituicao ... [RUN]
[0m08:23:40.897192 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_segmento_id_segmento.50e31d7c3a, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1)
[0m08:23:40.897192 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m08:23:40.901773 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m08:23:40.902808 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m08:23:40.905409 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m08:23:40.906416 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m08:23:40.907921 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: BEGIN
[0m08:23:40.907921 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.908930 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.908930 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"
[0m08:23:40.909930 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_atividade"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:40.910437 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.911444 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: ROLLBACK
[0m08:23:40.912951 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1'
[0m08:23:40.914604 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1: Close
[0m08:23:40.914604 [info ] [Thread-1 (]: 89 of 100 PASS not_null_fato_carteira_credito_atividade_id_instituicao ......... [[32mPASS[0m in 0.02s]
[0m08:23:40.915612 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1
[0m08:23:40.916260 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m08:23:40.916858 [info ] [Thread-1 (]: 90 of 100 START test not_null_fato_carteira_credito_porte_id_instituicao ....... [RUN]
[0m08:23:40.916858 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_atividade_id_instituicao.6b395296d1, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74)
[0m08:23:40.916858 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m08:23:40.921924 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m08:23:40.922465 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m08:23:40.925560 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m08:23:40.926574 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m08:23:40.927575 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: BEGIN
[0m08:23:40.927575 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.928596 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.928596 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"
[0m08:23:40.929121 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_porte"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:40.929700 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.931250 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: ROLLBACK
[0m08:23:40.931903 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74'
[0m08:23:40.931903 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74: Close
[0m08:23:40.933562 [info ] [Thread-1 (]: 90 of 100 PASS not_null_fato_carteira_credito_porte_id_instituicao ............. [[32mPASS[0m in 0.02s]
[0m08:23:40.934108 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74
[0m08:23:40.934642 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m08:23:40.935176 [info ] [Thread-1 (]: 91 of 100 START test not_null_fato_carteira_credito_produto_id_data ............ [RUN]
[0m08:23:40.935176 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_porte_id_instituicao.69912b1a74, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5)
[0m08:23:40.936183 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m08:23:40.942482 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m08:23:40.943515 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m08:23:40.946883 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m08:23:40.948972 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m08:23:40.949522 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: BEGIN
[0m08:23:40.949522 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.951603 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.952611 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"
[0m08:23:40.952611 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:23:40.953613 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.955212 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: ROLLBACK
[0m08:23:40.955837 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5'
[0m08:23:40.956851 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5: Close
[0m08:23:40.957357 [info ] [Thread-1 (]: 91 of 100 PASS not_null_fato_carteira_credito_produto_id_data .................. [[32mPASS[0m in 0.02s]
[0m08:23:40.958365 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5
[0m08:23:40.959366 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m08:23:40.959872 [info ] [Thread-1 (]: 92 of 100 START test not_null_fato_carteira_credito_produto_id_instituicao ..... [RUN]
[0m08:23:40.960553 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_data.49d6874cd5, now test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d)
[0m08:23:40.960553 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m08:23:40.966670 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m08:23:40.969693 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m08:23:40.971741 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m08:23:40.973296 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m08:23:40.974301 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: BEGIN
[0m08:23:40.974805 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.975386 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.975386 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"
[0m08:23:40.975386 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_carteira_credito_produto"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:40.977393 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.978394 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: ROLLBACK
[0m08:23:40.979894 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d'
[0m08:23:40.979894 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d: Close
[0m08:23:40.980898 [info ] [Thread-1 (]: 92 of 100 PASS not_null_fato_carteira_credito_produto_id_instituicao ........... [[32mPASS[0m in 0.02s]
[0m08:23:40.981977 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d
[0m08:23:40.981977 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m08:23:40.982981 [info ] [Thread-1 (]: 93 of 100 START test not_null_fato_regiao_credito_id_instituicao ............... [RUN]
[0m08:23:40.983555 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_carteira_credito_produto_id_instituicao.a9a1599a0d, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836)
[0m08:23:40.984161 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m08:23:40.988698 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m08:23:40.990211 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m08:23:40.992251 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m08:23:40.993284 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m08:23:40.995033 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: BEGIN
[0m08:23:40.995033 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:40.996046 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.996627 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"
[0m08:23:40.997235 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:40.997235 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:40.999579 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: ROLLBACK
[0m08:23:41.000585 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836'
[0m08:23:41.001088 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836: Close
[0m08:23:41.001088 [info ] [Thread-1 (]: 93 of 100 PASS not_null_fato_regiao_credito_id_instituicao ..................... [[32mPASS[0m in 0.02s]
[0m08:23:41.002352 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836
[0m08:23:41.002352 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m08:23:41.002352 [info ] [Thread-1 (]: 94 of 100 START test not_null_fato_regiao_credito_id_regiao .................... [RUN]
[0m08:23:41.003895 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_instituicao.3389ff3836, now test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21)
[0m08:23:41.003895 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m08:23:41.008635 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m08:23:41.010120 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m08:23:41.013330 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m08:23:41.015526 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m08:23:41.015526 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: BEGIN
[0m08:23:41.016590 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:41.017099 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.017099 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"
[0m08:23:41.018119 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_regiao
from "gold_warehouse"."main"."fato_regiao_credito"
where id_regiao is null



  
  
      
    ) dbt_internal_test
[0m08:23:41.019100 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.021676 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: ROLLBACK
[0m08:23:41.022377 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21'
[0m08:23:41.023391 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21: Close
[0m08:23:41.024403 [info ] [Thread-1 (]: 94 of 100 PASS not_null_fato_regiao_credito_id_regiao .......................... [[32mPASS[0m in 0.02s]
[0m08:23:41.024959 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21
[0m08:23:41.025529 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m08:23:41.025529 [info ] [Thread-1 (]: 95 of 100 START test relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [RUN]
[0m08:23:41.026542 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_regiao_credito_id_regiao.9facd79f21, now test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5)
[0m08:23:41.026542 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m08:23:41.034074 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m08:23:41.035456 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m08:23:41.041114 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m08:23:41.042118 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m08:23:41.044287 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: BEGIN
[0m08:23:41.044800 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:41.044800 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.044800 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"
[0m08:23:41.046548 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_regiao as from_field
    from "gold_warehouse"."main"."fato_regiao_credito"
    where id_regiao is not null
),

parent as (
    select id_regiao as to_field
    from "gold_warehouse"."main"."dim_regiao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:23:41.051262 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m08:23:41.052372 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: ROLLBACK
[0m08:23:41.053884 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5'
[0m08:23:41.053884 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5: Close
[0m08:23:41.055480 [info ] [Thread-1 (]: 95 of 100 PASS relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_  [[32mPASS[0m in 0.03s]
[0m08:23:41.056493 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5
[0m08:23:41.056493 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m08:23:41.056493 [info ] [Thread-1 (]: 96 of 100 START test not_null_fato_risco_credito_id_instituicao ................ [RUN]
[0m08:23:41.057492 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_regiao_credito_id_regiao__id_regiao__ref_dim_regiao_.b813c6fee5, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4)
[0m08:23:41.058597 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m08:23:41.064180 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m08:23:41.066737 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m08:23:41.069246 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m08:23:41.070770 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m08:23:41.070770 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: BEGIN
[0m08:23:41.070770 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:41.072883 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.072883 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"
[0m08:23:41.073411 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_risco_credito"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:23:41.073411 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:41.075219 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: ROLLBACK
[0m08:23:41.076247 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4'
[0m08:23:41.076247 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4: Close
[0m08:23:41.077307 [info ] [Thread-1 (]: 96 of 100 PASS not_null_fato_risco_credito_id_instituicao ...................... [[32mPASS[0m in 0.02s]
[0m08:23:41.078308 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4
[0m08:23:41.078308 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m08:23:41.079307 [info ] [Thread-1 (]: 97 of 100 START test not_null_fato_risco_credito_id_nivel_risco ................ [RUN]
[0m08:23:41.079812 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_instituicao.afce1aebb4, now test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393)
[0m08:23:41.079812 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m08:23:41.083726 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m08:23:41.085487 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m08:23:41.087513 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m08:23:41.088676 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m08:23:41.089690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: BEGIN
[0m08:23:41.089690 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:41.091195 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.091195 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"
[0m08:23:41.091195 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_nivel_risco
from "gold_warehouse"."main"."fato_risco_credito"
where id_nivel_risco is null



  
  
      
    ) dbt_internal_test
[0m08:23:41.092203 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.093308 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: ROLLBACK
[0m08:23:41.095003 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393'
[0m08:23:41.095003 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393: Close
[0m08:23:41.096831 [info ] [Thread-1 (]: 97 of 100 PASS not_null_fato_risco_credito_id_nivel_risco ...................... [[32mPASS[0m in 0.02s]
[0m08:23:41.097432 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393
[0m08:23:41.097432 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m08:23:41.098439 [info ] [Thread-1 (]: 98 of 100 START sql view model main.view_balanco_patrimonial_relatorios ........ [RUN]
[0m08:23:41.099051 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_risco_credito_id_nivel_risco.a8efac3393, now model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios)
[0m08:23:41.099604 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m08:23:41.105301 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m08:23:41.107352 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m08:23:41.125121 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m08:23:41.127132 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m08:23:41.127132 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: BEGIN
[0m08:23:41.128156 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:41.128686 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.129208 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m08:23:41.129208 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */

  
  create view "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_balanco_patrimonial"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
),
dim_classe AS (
    SELECT * FROM "gold_warehouse"."main"."dim_classe_instituicao"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    cl.descricao as classe_instituicao,
    
    -- Data
    t.data as data_base,
    
    -- Fatos Ativo
    f.disponibilidades,
    f.aplicacoes_interfinanceiras_liquidez,
    f.tvm_derivativos,
    f.operacoes_de_credito,
    f.provisao_operacoes_de_credito,
    f.operacoes_de_credito_liquidas_provisao,
    f.arrendamento_mercantil_a_receber,
    f.imobilizado_de_arrendamento,
    f.credores_antecipacao_valor_residual,
    f.provisao_arrendamento_mercantil,
    f.arrendamento_mercantil_liquido_de_provisao,
    f.outros_creditos_liquido_de_provisao,
    f.outros_ativos_realizaveis,
    f.permanente_ajustado,
    f.ativo_total_ajustado,
    f.ativo_total,
    
    -- Fatos Passivo
    f.depositos_vista,
    f.depositos_poupanca,
    f.depositos_interfinanceiros,
    f.depositos_a_prazo,
    f.conta_de_pagamento_pre_paga,
    f.depositos_outros,
    f.depositos,
    f.captacoes_mercado_aberto,
    f.letras_de_credito_imobiliario,
    f.letras_de_credito_agronegocio,
    f.letras_financeiras,
    f.obrigacoes_titulos_e_valores_mobiliarios_exterior,
    f.outros_recursos_de_aceites_e_emissao_de_titulos,
    f.recursos_aceites_cambiais,
    f.obrigacoes_emprestimos_repasses,
    f.captacoes,
    f.obrigacoes_por_instr_financeiros_derivativos,
    f.outras_obrigacoes,
    f.passivo_circulante_exigivel_longo_prazo,
    f.patrimonio_liquido,
    f.passivo_total

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
LEFT JOIN dim_classe cl ON i.id_classe = cl.id_classe
  );

[0m08:23:41.130927 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:41.133771 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m08:23:41.133771 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */
alter view "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_tmp" rename to "view_balanco_patrimonial_relatorios"
[0m08:23:41.135469 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.136496 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: COMMIT
[0m08:23:41.136496 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m08:23:41.136496 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: COMMIT
[0m08:23:41.138732 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:23:41.142312 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"
[0m08:23:41.142312 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_balanco_patrimonial_relatorios__dbt_backup" cascade
    
[0m08:23:41.142312 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:41.144476 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios: Close
[0m08:23:41.145023 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020958394F20>]}
[0m08:23:41.145023 [info ] [Thread-1 (]: 98 of 100 OK created sql view model main.view_balanco_patrimonial_relatorios ... [[32mOK[0m in 0.05s]
[0m08:23:41.146034 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios
[0m08:23:41.146034 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_dre_relatorios
[0m08:23:41.146539 [info ] [Thread-1 (]: 99 of 100 START sql view model main.view_dre_relatorios ........................ [RUN]
[0m08:23:41.147217 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.view_balanco_patrimonial_relatorios, now model.bacen_ifdata_analytics.view_dre_relatorios)
[0m08:23:41.147217 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_dre_relatorios
[0m08:23:41.151829 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m08:23:41.152832 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_dre_relatorios
[0m08:23:41.155661 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m08:23:41.156348 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m08:23:41.156348 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: BEGIN
[0m08:23:41.157348 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:41.157348 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.158352 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m08:23:41.158352 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_dre_relatorios"} */

  
  create view "gold_warehouse"."main"."view_dre_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_demonstracao_resultado"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
),
dim_classe AS (
    SELECT * FROM "gold_warehouse"."main"."dim_classe_instituicao"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    cl.descricao as classe_instituicao,
    
    -- Data
    t.data as data_base,
    
    -- DRE - Receitas Intermediação
    f.rendas_operacoes_de_credito,
    f.rendas_operacoes_de_arrendamento_mercantil,
    f.rendas_operacoes_tvm,
    f.rendas_operacoes_instrumentos_financeiros_derivativos,
    f.resultado_operacoes_cambio,
    f.rendas_aplicacoes_compulsorias,
    f.receitas_intermediacao_financeira,
    
    -- DRE - Despesas Intermediação
    f.despesas_captacao,
    f.despesas_obrigacoes_emprestimos_repasses,
    f.despesas_operacoes_arrendamento_mercantil,
    f.despesas_operacoes_cambio,
    f.resultado_provisao_creditos_dificil_liquidacao,
    f.despesas_intermediacao_financeira,
    
    -- DRE - Resultado Intermediação
    f.resultado_intermediacao_financeira,
    
    -- DRE - Outras Receitas/Despesas Operacionais
    f.rendas_prestacao_servicos,
    f.rendas_tarifas_bancarias,
    f.despesas_pessoal,
    f.despesas_administrativas,
    f.despesas_tributarias,
    f.resultado_participacoes,
    f.outras_receitas_operacionais,
    f.outras_despesas_operacionais,
    f.outras_receitas_despesas_operacionais,
    
    -- DRE - Resultados
    f.resultado_operacional,
    f.resultado_nao_operacional,
    f.resultado_antes_tributacao,
    f.imposto_renda_contribuicao_social,
    f.participacao_lucros,
    f.lucro_liquido,
    f.juros_sobre_capital,
    
    -- KPIs
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
LEFT JOIN dim_classe cl ON i.id_classe = cl.id_classe
  );

[0m08:23:41.159857 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.163290 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m08:23:41.163614 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_dre_relatorios"} */
alter view "gold_warehouse"."main"."view_dre_relatorios__dbt_tmp" rename to "view_dre_relatorios"
[0m08:23:41.163614 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:41.165625 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: COMMIT
[0m08:23:41.166129 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m08:23:41.166129 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: COMMIT
[0m08:23:41.167660 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.171159 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_dre_relatorios"
[0m08:23:41.171159 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_dre_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_dre_relatorios__dbt_backup" cascade
    
[0m08:23:41.172274 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:41.173281 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_dre_relatorios: Close
[0m08:23:41.173786 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020958394DA0>]}
[0m08:23:41.173786 [info ] [Thread-1 (]: 99 of 100 OK created sql view model main.view_dre_relatorios ................... [[32mOK[0m in 0.03s]
[0m08:23:41.176163 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_dre_relatorios
[0m08:23:41.176163 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m08:23:41.177278 [info ] [Thread-1 (]: 100 of 100 START sql view model main.view_resumo_financeiro_relatorios ......... [RUN]
[0m08:23:41.177278 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.view_dre_relatorios, now model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios)
[0m08:23:41.178169 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m08:23:41.182063 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m08:23:41.183726 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m08:23:41.186576 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m08:23:41.188199 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m08:23:41.189216 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: BEGIN
[0m08:23:41.189216 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:23:41.189216 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.190721 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m08:23:41.191256 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

  
  create view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" as (
    

WITH fatos AS (
    SELECT * FROM "gold_warehouse"."main"."fato_resumo_financeiro"
),
dim_inst AS (
    SELECT * FROM "gold_warehouse"."main"."dim_instituicao"
),
dim_tempo AS (
    SELECT * FROM "gold_warehouse"."main"."dim_tempo"
),
dim_seg AS (
    SELECT * FROM "gold_warehouse"."main"."dim_segmento"
),
dim_loc AS (
    SELECT * FROM "gold_warehouse"."main"."dim_localizacao"
),
dim_cont AS (
    SELECT * FROM "gold_warehouse"."main"."dim_controle"
),
dim_cons AS (
    SELECT * FROM "gold_warehouse"."main"."dim_consolidado"
)

SELECT
    f.id_instituicao,
    f.id_data,
    
    -- Instituição
    i.codigo_origem,
    i.nome as nome_instituicao,
    i.tipo_instituicao,
    i.nome_conglomerado,
    
    -- Tipo do Relatório Filtrado
    i.tipo_relatorio_bcb,
    
    -- Atributos Dimensionais
    s.descricao as segmento,
    l.cidade,
    l.uf,
    l.regiao,
    c.descricao as tipo_de_controle,
    cb.descricao as consolidado_bancario,
    
    -- Data
    t.data as data_base,
    
    -- Fatos (Métricas dbt)
    f.ativo_total,
    f.carteira_credito,
    f.passivo_exigivel,
    f.captacoes,
    f.patrimonio_liquido,
    f.lucro_liquido,
    f.quantidade_agencias,
    f.quantidade_postos_atendimento,
    f.roe,
    f.roa

FROM fatos f
LEFT JOIN dim_inst i ON f.id_instituicao = i.id_instituicao
LEFT JOIN dim_tempo t ON f.id_data = t.id_data
LEFT JOIN dim_seg s ON i.id_segmento = s.id_segmento
LEFT JOIN dim_loc l ON i.id_localizacao = l.id_localizacao
LEFT JOIN dim_cont c ON i.id_controle = c.id_controle
LEFT JOIN dim_cons cb ON i.id_consolidado = cb.id_consolidado
  );

[0m08:23:41.192284 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.196519 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m08:23:41.196519 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */
alter view "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_tmp" rename to "view_resumo_financeiro_relatorios"
[0m08:23:41.197054 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:41.198732 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m08:23:41.199425 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m08:23:41.199425 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: COMMIT
[0m08:23:41.200958 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:23:41.203753 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"
[0m08:23:41.203753 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios"} */

      drop view if exists "gold_warehouse"."main"."view_resumo_financeiro_relatorios__dbt_backup" cascade
    
[0m08:23:41.205317 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:23:41.205937 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios: Close
[0m08:23:41.205937 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '116ec0a5-8c23-4d66-a885-292f02517799', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020958750170>]}
[0m08:23:41.205937 [info ] [Thread-1 (]: 100 of 100 OK created sql view model main.view_resumo_financeiro_relatorios .... [[32mOK[0m in 0.03s]
[0m08:23:41.207481 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios
[0m08:23:41.210015 [debug] [MainThread]: Using duckdb connection "master"
[0m08:23:41.210663 [debug] [MainThread]: On master: BEGIN
[0m08:23:41.210663 [debug] [MainThread]: Opening a new connection, currently in state closed
[0m08:23:41.211201 [debug] [MainThread]: SQL status: OK in 0.001 seconds
[0m08:23:41.212219 [debug] [MainThread]: On master: COMMIT
[0m08:23:41.212219 [debug] [MainThread]: Using duckdb connection "master"
[0m08:23:41.212219 [debug] [MainThread]: On master: COMMIT
[0m08:23:41.212219 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m08:23:41.212219 [debug] [MainThread]: On master: Close
[0m08:23:41.213215 [debug] [MainThread]: Connection 'master' was properly closed.
[0m08:23:41.213717 [debug] [MainThread]: Connection 'create_gold_warehouse_main' was properly closed.
[0m08:23:41.213717 [debug] [MainThread]: Connection 'list_gold_warehouse_main' was properly closed.
[0m08:23:41.213717 [debug] [MainThread]: Connection 'model.bacen_ifdata_analytics.view_resumo_financeiro_relatorios' was properly closed.
[0m08:23:41.213717 [info ] [MainThread]: 
[0m08:23:41.214719 [info ] [MainThread]: Finished running 10 seeds, 26 table models, 61 data tests, 3 view models in 0 hours 0 minutes and 41.42 seconds (41.42s).
[0m08:23:41.224794 [debug] [MainThread]: Command end result
[0m08:23:41.264463 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m08:23:41.270751 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m08:23:41.280060 [debug] [MainThread]: Wrote artifact RunExecutionResult to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\run_results.json
[0m08:23:41.280060 [info ] [MainThread]: 
[0m08:23:41.281085 [info ] [MainThread]: [32mCompleted successfully[0m
[0m08:23:41.281085 [info ] [MainThread]: 
[0m08:23:41.282241 [info ] [MainThread]: Done. PASS=100 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=100
[0m08:23:41.283841 [warn ] [MainThread]: [[33mWARNING[0m][DeprecationsSummary]: Deprecated functionality
Summary of encountered deprecations:
- MissingArgumentsPropertyInGenericTestDeprecation: 22 occurrences
To see all deprecation instances instead of just the first occurrence of each,
run command again with the `--show-all-deprecations` flag. You may also need to
run with `--no-partial-parse` as some deprecations are only encountered during
parsing.
[0m08:23:41.284873 [debug] [MainThread]: Command `dbt build` succeeded at 08:23:41.284873 after 43.84 seconds
[0m08:23:41.285546 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209367F7980>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020935F96B70>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020935F96ED0>]}
[0m08:23:41.285546 [debug] [MainThread]: Flushing usage events
[0m08:23:42.219370 [debug] [MainThread]: An error was encountered while trying to flush usage events
[0m08:35:48.583892 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020929571DF0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092660E900>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x00000209296077A0>]}


============================== 08:35:48.588705 | 623e94ac-f130-4735-aa62-c02d4b3bc328 ==============================
[0m08:35:48.588705 [info ] [MainThread]: Running with dbt=1.11.5
[0m08:35:48.588705 [debug] [MainThread]: running dbt with arguments {'version_check': 'True', 'no_print': 'None', 'static_parser': 'True', 'target_path': 'None', 'warn_error_options': 'WarnErrorOptionsV2(error=[], warn=[], silence=[])', 'printer_width': '80', 'write_json': 'True', 'introspect': 'True', 'log_cache_events': 'False', 'empty': 'False', 'cache_selected_only': 'False', 'log_format': 'default', 'debug': 'False', 'fail_fast': 'False', 'partial_parse': 'True', 'send_anonymous_usage_stats': 'True', 'quiet': 'False', 'warn_error': 'None', 'profiles_dir': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics', 'indirect_selection': 'eager', 'invocation_command': 'dbt build --select +view_resumo_financeiro_relatorios +view_balanco_patrimonial_relatorios +view_dre_relatorios', 'use_colors': 'True', 'use_experimental_parser': 'False', 'log_path': 'C:\\WorkspaceHub\\SourceHub\\bacen-ifdata-scraper\\src\\bacen_ifdata\\data_analytics\\logs'}
[0m08:35:48.832888 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'project_id', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092B5BB800>]}
[0m08:35:48.877091 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'adapter_info', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020929CAC920>]}
[0m08:35:48.890902 [info ] [MainThread]: Registered adapter: duckdb=1.10.0
[0m08:35:49.379438 [debug] [MainThread]: checksum: 917838c7befe257b9b22a76c21e5785f6f23ac83ef0336e2870f03c9c3f28402, vars: {}, profile: , target: , version: 1.11.5
[0m08:35:49.477829 [info ] [MainThread]: Unable to do partial parsing because profile has changed
[0m08:35:49.479686 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x0000020929C36C30>]}
[0m08:35:51.752478 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'experimental_parser', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092BD29B80>]}
[0m08:35:52.110380 [warn ] [MainThread]: [[33mWARNING[0m][MissingArgumentsPropertyInGenericTestDeprecation]: Deprecated
functionality
Found top-level arguments to test `relationships` defined on 'dim_instituicao'
in package 'bacen_ifdata_analytics' (models\gold\schema.yml). Arguments to
generic tests should be nested under the `arguments` property.
[0m08:35:52.111306 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'deprecation', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'property_': 'warn', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092BF58CE0>]}
[0m08:35:52.472051 [warn ] [MainThread]: [[33mWARNING[0m]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.bacen_ifdata_analytics.silver
[0m08:35:52.481029 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092C0733B0>]}
[0m08:35:52.567002 [debug] [MainThread]: Wrote artifact WritableManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\manifest.json
[0m08:35:52.574652 [debug] [MainThread]: Wrote artifact SemanticManifest to C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\target\semantic_manifest.json
[0m08:35:52.650202 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092BF25280>]}
[0m08:35:52.650711 [info ] [MainThread]: Found 29 models, 10 seeds, 61 data tests, 32 sources, 590 macros
[0m08:35:52.658472 [info ] [MainThread]: 
[0m08:35:52.659976 [info ] [MainThread]: Concurrency: 1 threads (target='dev')
[0m08:35:52.660532 [info ] [MainThread]: 
[0m08:35:52.660532 [debug] [MainThread]: Acquiring new duckdb connection 'master'
[0m08:35:52.666979 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse'
[0m08:35:54.654596 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse"
[0m08:35:54.654596 [debug] [ThreadPool]: On list_gold_warehouse: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse"} */

    
    select schema_name
    from system.information_schema.schemata
    
    where lower(catalog_name) = '"gold_warehouse"'
    
  
  
[0m08:35:54.654596 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m08:35:55.240366 [debug] [ThreadPool]: SQL status: OK in 0.586 seconds
[0m08:35:55.241872 [debug] [ThreadPool]: On list_gold_warehouse: Close
[0m08:35:55.241872 [debug] [ThreadPool]: Re-using an available connection from the pool (formerly list_gold_warehouse, now create_gold_warehouse_main)
[0m08:35:55.243400 [debug] [ThreadPool]: Creating schema "database: "gold_warehouse"
schema: "main"
"
[0m08:35:55.247123 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m08:35:55.248687 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
        select type from duckdb_databases()
        where lower(database_name)='gold_warehouse'
        and type='sqlite'
    
  
[0m08:35:55.248687 [debug] [ThreadPool]: Opening a new connection, currently in state closed
[0m08:35:55.249819 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m08:35:55.250826 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m08:35:55.250826 [debug] [ThreadPool]: On create_gold_warehouse_main: BEGIN
[0m08:35:55.251332 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m08:35:55.251332 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m08:35:55.251931 [debug] [ThreadPool]: On create_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "create_gold_warehouse_main"} */

    
    
        create schema if not exists "gold_warehouse"."main"
    
[0m08:35:55.252936 [debug] [ThreadPool]: SQL status: OK in 0.001 seconds
[0m08:35:55.252936 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m08:35:55.253952 [debug] [ThreadPool]: Using duckdb connection "create_gold_warehouse_main"
[0m08:35:55.253952 [debug] [ThreadPool]: On create_gold_warehouse_main: COMMIT
[0m08:35:55.254463 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m08:35:55.254463 [debug] [ThreadPool]: On create_gold_warehouse_main: Close
[0m08:35:55.257161 [debug] [ThreadPool]: Acquiring new duckdb connection 'list_gold_warehouse_main'
[0m08:35:55.261034 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m08:35:55.261433 [debug] [ThreadPool]: On list_gold_warehouse_main: BEGIN
[0m08:35:55.261433 [debug] [ThreadPool]: Opening a new connection, currently in state init
[0m08:35:55.261433 [debug] [ThreadPool]: SQL status: OK in 0.000 seconds
[0m08:35:55.261433 [debug] [ThreadPool]: Using duckdb connection "list_gold_warehouse_main"
[0m08:35:55.262439 [debug] [ThreadPool]: On list_gold_warehouse_main: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "connection_name": "list_gold_warehouse_main"} */
select
      'gold_warehouse' as database,
      table_name as name,
      table_schema as schema,
      CASE table_type
        WHEN 'BASE TABLE' THEN 'table'
        WHEN 'VIEW' THEN 'view'
        WHEN 'LOCAL TEMPORARY' THEN 'table'
        END as type
    from system.information_schema.tables
    where lower(table_schema) = 'main'
    and lower(table_catalog) = 'gold_warehouse'
  
[0m08:35:55.276306 [debug] [ThreadPool]: SQL status: OK in 0.014 seconds
[0m08:35:55.277222 [debug] [ThreadPool]: On list_gold_warehouse_main: ROLLBACK
[0m08:35:55.289271 [debug] [ThreadPool]: Failed to rollback 'list_gold_warehouse_main'
[0m08:35:55.290783 [debug] [ThreadPool]: On list_gold_warehouse_main: Close
[0m08:35:55.293207 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092BB79760>]}
[0m08:35:55.293207 [debug] [MainThread]: Using duckdb connection "master"
[0m08:35:55.294868 [debug] [MainThread]: On master: BEGIN
[0m08:35:55.294868 [debug] [MainThread]: Opening a new connection, currently in state init
[0m08:35:55.295394 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m08:35:55.295394 [debug] [MainThread]: On master: COMMIT
[0m08:35:55.295394 [debug] [MainThread]: Using duckdb connection "master"
[0m08:35:55.295938 [debug] [MainThread]: On master: COMMIT
[0m08:35:55.295938 [debug] [MainThread]: SQL status: OK in 0.000 seconds
[0m08:35:55.296517 [debug] [MainThread]: On master: Close
[0m08:35:55.301186 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_instituicao
[0m08:35:55.301721 [info ] [Thread-1 (]: 1 of 59 START sql table model main.dim_instituicao ............................. [RUN]
[0m08:35:55.301721 [debug] [Thread-1 (]: Acquiring new duckdb connection 'model.bacen_ifdata_analytics.dim_instituicao'
[0m08:35:55.301721 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_instituicao
[0m08:35:55.314582 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.315596 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_instituicao
[0m08:35:55.342118 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.343124 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.344676 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: BEGIN
[0m08:35:55.344676 [debug] [Thread-1 (]: Opening a new connection, currently in state init
[0m08:35:55.344676 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:55.344676 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.346350 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_instituicao__dbt_tmp"
  
    as (
      

WITH prudential AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Prudencial' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."prudential_conglomerates_summary"
),

financial AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_summary"
),

individual AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        NULL as segmento,
        'Instituicao Individual' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        tipo_de_instituicao,
        conglomerado as nome_conglomerado
    FROM "silver"."main"."individual_institutions_summary"
),

exchange AS (
    SELECT 
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Instituição de Câmbio' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
),

-- Fallback: instituições presentes nas tabelas de portfólio (SCR) mas ausentes dos resumos.
-- Isso garante integridade referencial completa para todas as tabelas fato.
portfolio_fallback AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro (SCR)' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

portfolio_fallback_standard AS (
    SELECT DISTINCT
        codigo as codigo_origem,
        instituicao as nome,
        segmento_resolucao as segmento,
        'Conglomerado Financeiro' as tipo_instituicao,
        cidade, uf, regiao,
        tipo_de_controle,
        consolidado_bancario,
        NULL as tipo_de_instituicao,
        NULL as nome_conglomerado
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    WHERE codigo NOT IN (
        SELECT DISTINCT codigo FROM "silver"."main"."financial_conglomerates_summary"
    )
),

unificacao AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM prudential
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Prudencial' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."prudential_conglomerates_segmentation"

    UNION

    -- Conglomerados Financeiros - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM financial
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_capital_information"

    UNION

    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios Independent (Financial Conglomerates SCR) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro (SCR)' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, segmento as tipo_de_instituicao, NULL as nome_conglomerado FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"

    UNION

    -- Financial Conglomerates Portfolios (Standard) - Carteira PF Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Modalidade e Prazo
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Atividade Econômica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Carteira PJ Porte
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Nível de Risco
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Região Geográfica
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Indexador
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Financial Conglomerates Portfolios (Standard) - Quantidade de Clientes
    SELECT codigo as codigo_origem, instituicao as nome, segmento_resolucao as segmento, 'Conglomerado Financeiro' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, NULL, NULL FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"

    UNION

    -- Instituições Individuais - Resumo
    SELECT codigo_origem, nome, segmento, tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, nome_conglomerado FROM individual
    UNION
    -- Instituições Individuais - Ativo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT codigo as codigo_origem, instituicao as nome, NULL as segmento, 'Instituicao Individual' as tipo_instituicao, cidade, uf, regiao, tipo_de_controle, consolidado_bancario, tipo_de_instituicao, conglomerado FROM "silver"."main"."individual_institutions_income_statement"

    UNION

    -- Câmbio
    SELECT * FROM exchange
    UNION
    -- Fallback SCR
    SELECT * FROM portfolio_fallback
    UNION
    -- Fallback Standard
    SELECT * FROM portfolio_fallback_standard
)
,

final_with_id AS (
    SELECT
        
    
        md5(cast(cast(codigo_origem as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
        codigo_origem,
        nome,
        tipo_instituicao,
        CASE 
            WHEN tipo_instituicao = 'Instituicao Individual' THEN 'Instituições Individuais'
            WHEN tipo_instituicao IN ('Conglomerado Financeiro', 'Conglomerado Financeiro (SCR)') THEN 'Conglomerados Financeiros e Instituições Independentes'
            WHEN tipo_instituicao = 'Conglomerado Prudencial' THEN 'Conglomerados Prudenciais e Instituições Independentes'
            WHEN tipo_instituicao = 'Instituição de Câmbio' THEN 'Instituições com Operações de Câmbio'
        END AS tipo_relatorio_bcb,
        md5(cast(lower(nullif(segmento, '')) as varchar)) as id_segmento,
        md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
        md5(cast(nullif(tipo_de_controle, '') as varchar)) as id_controle,
        md5(cast(lower(nullif(consolidado_bancario, '')) as varchar)) as id_consolidado,
        md5(cast(nullif(tipo_de_instituicao, '') as varchar)) as id_classe,
        nome_conglomerado
    FROM unificacao
)

SELECT * FROM final_with_id
QUALIFY row_number() OVER (PARTITION BY id_instituicao ORDER BY nome DESC, codigo_origem DESC) = 1
    );
  
  
[0m08:35:55.822287 [debug] [Thread-1 (]: SQL status: OK in 0.475 seconds
[0m08:35:55.826626 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.826626 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m08:35:55.827606 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:55.827606 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.827606 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_instituicao'
  
[0m08:35:55.829715 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:55.835286 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.835286 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao" rename to "dim_instituicao__dbt_backup"
[0m08:35:55.836309 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:55.838515 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.838515 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */
alter table "gold_warehouse"."main"."dim_instituicao__dbt_tmp" rename to "dim_instituicao"
[0m08:35:55.839545 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:55.849333 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m08:35:55.849333 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.849968 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: COMMIT
[0m08:35:55.860417 [debug] [Thread-1 (]: SQL status: OK in 0.010 seconds
[0m08:35:55.864462 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_instituicao"
[0m08:35:55.864462 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_instituicao"} */

      drop table if exists "gold_warehouse"."main"."dim_instituicao__dbt_backup" cascade
    
[0m08:35:55.865470 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:55.867816 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_instituicao: Close
[0m08:35:55.869355 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092C417650>]}
[0m08:35:55.869355 [info ] [Thread-1 (]: 1 of 59 OK created sql table model main.dim_instituicao ........................ [[32mOK[0m in 0.57s]
[0m08:35:55.870936 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_instituicao
[0m08:35:55.870936 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_localizacao
[0m08:35:55.870936 [info ] [Thread-1 (]: 2 of 59 START sql table model main.dim_localizacao ............................. [RUN]
[0m08:35:55.871941 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_instituicao, now model.bacen_ifdata_analytics.dim_localizacao)
[0m08:35:55.871941 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_localizacao
[0m08:35:55.875098 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.876106 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_localizacao
[0m08:35:55.879107 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.880128 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.881252 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: BEGIN
[0m08:35:55.881252 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:55.881913 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:55.882925 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.883430 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_localizacao__dbt_tmp"
  
    as (
      

WITH location_sources AS (
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."prudential_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_summary"
    WHERE cidade IS NOT NULL
    
    UNION
    
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."individual_institutions_summary"
    WHERE cidade IS NOT NULL

    UNION

    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
    WHERE cidade IS NOT NULL

    UNION

    -- Fallback: localizações de instituições presentes apenas nas tabelas SCR
    SELECT DISTINCT
        cidade,
        uf,
        regiao
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    WHERE cidade IS NOT NULL
)

SELECT
    -- Create a surrogate key based on the unique combination of location fields
    md5(cast(coalesce(cidade, '') || coalesce(uf, '') || coalesce(regiao, '') as varchar)) as id_localizacao,
    cidade,
    uf,
    regiao
FROM location_sources

UNION

-- Sentinel para instituições sem dados de localização (cidade, uf, regiao = NULL)
SELECT
    md5(cast('' as varchar)) as id_localizacao,
    NULL as cidade,
    NULL as uf,
    NULL as regiao
    );
  
  
[0m08:35:55.946731 [debug] [Thread-1 (]: SQL status: OK in 0.063 seconds
[0m08:35:55.948368 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.948368 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m08:35:55.948977 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:55.949563 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.949563 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_localizacao'
  
[0m08:35:55.950584 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:55.953225 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.953225 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao" rename to "dim_localizacao__dbt_backup"
[0m08:35:55.953799 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:55.955422 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.955422 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */
alter table "gold_warehouse"."main"."dim_localizacao__dbt_tmp" rename to "dim_localizacao"
[0m08:35:55.956429 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:55.957430 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m08:35:55.957430 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.957430 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: COMMIT
[0m08:35:55.958428 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:55.960941 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_localizacao"
[0m08:35:55.961446 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_localizacao"} */

      drop table if exists "gold_warehouse"."main"."dim_localizacao__dbt_backup" cascade
    
[0m08:35:55.962452 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:55.962452 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_localizacao: Close
[0m08:35:55.963467 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092C43EA20>]}
[0m08:35:55.963467 [info ] [Thread-1 (]: 2 of 59 OK created sql table model main.dim_localizacao ........................ [[32mOK[0m in 0.09s]
[0m08:35:55.964712 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_localizacao
[0m08:35:55.964712 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.dim_tempo
[0m08:35:55.965244 [info ] [Thread-1 (]: 3 of 59 START sql table model main.dim_tempo ................................... [RUN]
[0m08:35:55.965833 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_localizacao, now model.bacen_ifdata_analytics.dim_tempo)
[0m08:35:55.965833 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.dim_tempo
[0m08:35:55.973463 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:55.973463 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.dim_tempo
[0m08:35:55.976840 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:55.977838 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:55.977838 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: BEGIN
[0m08:35:55.977838 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:55.979362 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:55.979362 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:55.979976 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

  
    
    

    create  table
      "gold_warehouse"."main"."dim_tempo__dbt_tmp"
  
    as (
      

WITH datas_unicas AS (
    -- Conglomerados Prudenciais - Resumo
    SELECT DISTINCT data_base as data
    FROM "silver"."main"."prudential_conglomerates_summary"
    UNION
    -- Conglomerados Prudenciais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_assets"
    UNION
    -- Conglomerados Prudenciais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_liabilities"
    UNION
    -- Conglomerados Prudenciais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_income_statement"
    UNION
    -- Conglomerados Prudenciais - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_capital_information"
    UNION
    -- Conglomerados Prudenciais - Segmentação
    SELECT DISTINCT data_base
    FROM "silver"."main"."prudential_conglomerates_segmentation"
    UNION
    -- Conglomerados Financeiros - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_summary"
    UNION
    -- Conglomerados Financeiros - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_assets"
    UNION
    -- Conglomerados Financeiros - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_liabilities"
    UNION
    -- Conglomerados Financeiros - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_income_statement"
    UNION
    -- Conglomerados Financeiros - Informações de Capital
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_capital_information"
    UNION
    -- Instituições Individuais - Resumo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_summary"
    UNION
    -- Instituições Individuais - Ativo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_assets"
    UNION
    -- Instituições Individuais - Passivo
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_liabilities"
    UNION
    -- Instituições Individuais - Demonstração de Resultado
    SELECT DISTINCT data_base
    FROM "silver"."main"."individual_institutions_income_statement"
    UNION
    -- Conglomerados Financeiros - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_individuals_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_type_maturity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_economic_activity"
    UNION
    -- Conglomerados Financeiros - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_legal_person_business_size"
    UNION
    -- Conglomerados Financeiros - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_risk_level"
    UNION
    -- Conglomerados Financeiros - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_geographic_region"
    UNION
    -- Conglomerados Financeiros - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_indexer"
    UNION
    -- Conglomerados Financeiros - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_portfolio_number_clients_operations"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PF Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_individuals_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Modalidade e Prazo
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_type_maturity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Atividade Econômica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_economic_activity"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Carteira PJ Porte
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_legal_person_business_size"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Nível de Risco
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_risk_level"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Região Geográfica
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_geographic_region"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Indexador
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_indexer"
    UNION
    -- SCR Portfolios (Financial Conglomerates) - Quantidade de Clientes
    SELECT DISTINCT data_base
    FROM "silver"."main"."financial_conglomerates_scr_portfolio_number_clients_operations"
    UNION
    -- Câmbio
    SELECT DISTINCT data_base
    FROM "silver"."main"."foreign_exchange_quarterly_foreign_currency_flow"
)

SELECT
    strftime(data, '%Y%m%d')::int as id_data,
    data,
    extract(year from data)::int as ano,
    extract(quarter from data)::int as trimestre,
    extract(month from data)::int as mes
FROM datas_unicas
    );
  
  
[0m08:35:56.058747 [debug] [Thread-1 (]: SQL status: OK in 0.078 seconds
[0m08:35:56.058747 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:56.059745 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m08:35:56.059745 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.061185 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:56.061185 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'dim_tempo'
  
[0m08:35:56.062217 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.064301 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:56.064301 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo" rename to "dim_tempo__dbt_backup"
[0m08:35:56.065331 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.066984 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:56.066984 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */
alter table "gold_warehouse"."main"."dim_tempo__dbt_tmp" rename to "dim_tempo"
[0m08:35:56.067996 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.069012 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m08:35:56.069012 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:56.069012 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: COMMIT
[0m08:35:56.070723 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:56.072290 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.dim_tempo"
[0m08:35:56.072808 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.dim_tempo"} */

      drop table if exists "gold_warehouse"."main"."dim_tempo__dbt_backup" cascade
    
[0m08:35:56.073323 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:56.074882 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.dim_tempo: Close
[0m08:35:56.074882 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092C416420>]}
[0m08:35:56.075545 [info ] [Thread-1 (]: 3 of 59 OK created sql table model main.dim_tempo .............................. [[32mOK[0m in 0.11s]
[0m08:35:56.075545 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.dim_tempo
[0m08:35:56.076558 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m08:35:56.076558 [info ] [Thread-1 (]: 4 of 59 START sql table model main.fato_balanco_patrimonial .................... [RUN]
[0m08:35:56.077557 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.dim_tempo, now model.bacen_ifdata_analytics.fato_balanco_patrimonial)
[0m08:35:56.077557 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m08:35:56.082090 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.082090 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m08:35:56.085438 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.086471 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.086471 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: BEGIN
[0m08:35:56.086471 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:56.087467 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.087467 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.087992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp"
  
    as (
      

WITH prudential_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos (Prudential version with accents on some cols)
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l."obrigações_operações_compromissadas" as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l."outras_obrigações" as outras_obrigacoes,
        l."passivo_circulante_exigível_a_longo_prazo" as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."prudential_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."prudential_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

prudential AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM prudential_sources
),

financial_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."financial_conglomerates_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."financial_conglomerates_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

financial AS (
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM financial_sources
),

individual_sources AS (
    SELECT 
        COALESCE(a.codigo, l.codigo) as codigo,
        COALESCE(a.data_base, l.data_base) as data_base,
        a.disponibilidades,
        a.aplicacoes_interfinanceiras_liquidez,
        a.tvm_e_instrumentos_financeiros_derivativos as tvm_derivativos,
        a.operacoes_de_credito,
        a.provisao_operacoes_de_credito,
        a.operacoes_de_credito_liquidas_provisao,
        a.arrendamento_mercantil_a_receber,
        a.imobilizado_de_arrendamento,
        a.credores_antecipacao_valor_residual,
        a.provisao_arrendamento_mercantil,
        a.arrendamento_mercantil_liquido_de_provisao,
        a.outros_creditos_liquido_de_provisao,
        a.outros_ativos_realizaveis,
        a.permanente_ajustado,
        a.ativo_total_ajustado,
        a.ativo_total,
        
        -- Detalhes Passivos
        l.depositos_vista,
        l.depositos_poupanca,
        l.depositos_interfinanceiros,
        l.depositos_a_prazo,
        l.conta_de_pagamento_pre_paga,
        l.depositos_outros,
        l.deposito_total as depositos,
        l.obrigacoes_operacoes_compromissadas as captacoes_mercado_aberto,
        l.letras_de_credito_imobiliario,
        l.letras_de_credito_agronegocio,
        l.letras_financeiras,
        l.obrigacoes_titulos_e_valores_mobiliarios_exterior,
        l.outros_recursos_de_aceites_e_emissao_de_titulos,
        l.recursos_de_aceites_e_emissao_de_titulos as recursos_aceites_cambiais,
        l.obrigacoes_emprestimos_e_repasses as obrigacoes_emprestimos_repasses,
        l.captacoes,
        l.instrumentos_derivativos as obrigacoes_por_instr_financeiros_derivativos,
        l.outras_obrigacoes,
        l.passivo_circulante_exigivel_a_longo_prazo as passivo_circulante_exigivel_longo_prazo,
        l.patrimonio_liquido
    FROM (SELECT * FROM "silver"."main"."individual_institutions_assets" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) a
    FULL OUTER JOIN (SELECT * FROM "silver"."main"."individual_institutions_liabilities" QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY codigo) = 1) l
      ON a.codigo = l.codigo AND a.data_base = l.data_base
),

individual AS (
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_consolidado,
        -- Ativos
        disponibilidades,
        aplicacoes_interfinanceiras_liquidez,
        tvm_derivativos,
        operacoes_de_credito,
        provisao_operacoes_de_credito,
        operacoes_de_credito_liquidas_provisao,
        arrendamento_mercantil_a_receber,
        imobilizado_de_arrendamento,
        credores_antecipacao_valor_residual,
        provisao_arrendamento_mercantil,
        arrendamento_mercantil_liquido_de_provisao,
        outros_creditos_liquido_de_provisao,
        outros_ativos_realizaveis,
        permanente_ajustado,
        ativo_total_ajustado,
        ativo_total,
        -- Passivos Detalhados
        depositos_vista,
        depositos_poupanca,
        depositos_interfinanceiros,
        depositos_a_prazo,
        conta_de_pagamento_pre_paga,
        depositos_outros,
        depositos,
        captacoes_mercado_aberto,
        letras_de_credito_imobiliario,
        letras_de_credito_agronegocio,
        letras_financeiras,
        obrigacoes_titulos_e_valores_mobiliarios_exterior,
        outros_recursos_de_aceites_e_emissao_de_titulos,
        recursos_aceites_cambiais,
        obrigacoes_emprestimos_repasses,
        captacoes,
        obrigacoes_por_instr_financeiros_derivativos,
        outras_obrigacoes,
        passivo_circulante_exigivel_longo_prazo,
        patrimonio_liquido,
        (ativo_total - patrimonio_liquido) as passivo_total
    FROM individual_sources
),

unificacao AS (
    SELECT * FROM prudential
    UNION ALL
    SELECT * FROM financial
    UNION ALL
    SELECT * FROM individual
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_consolidado)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    tipo_consolidado,
    
    -- Ativos
    disponibilidades,
    aplicacoes_interfinanceiras_liquidez,
    tvm_derivativos,
    operacoes_de_credito,
    provisao_operacoes_de_credito,
    operacoes_de_credito_liquidas_provisao,
    arrendamento_mercantil_a_receber,
    imobilizado_de_arrendamento,
    credores_antecipacao_valor_residual,
    provisao_arrendamento_mercantil,
    arrendamento_mercantil_liquido_de_provisao,
    outros_creditos_liquido_de_provisao,
    outros_ativos_realizaveis,
    permanente_ajustado,
    ativo_total_ajustado,
    ativo_total,
    
    -- Passivos (Novas Contas Inseridas)
    depositos_vista,
    depositos_poupanca,
    depositos_interfinanceiros,
    depositos_a_prazo,
    conta_de_pagamento_pre_paga,
    depositos_outros,
    depositos,
    captacoes_mercado_aberto,
    letras_de_credito_imobiliario,
    letras_de_credito_agronegocio,
    letras_financeiras,
    obrigacoes_titulos_e_valores_mobiliarios_exterior,
    outros_recursos_de_aceites_e_emissao_de_titulos,
    recursos_aceites_cambiais,
    obrigacoes_emprestimos_repasses,
    captacoes,
    obrigacoes_por_instr_financeiros_derivativos,
    outras_obrigacoes,
    passivo_circulante_exigivel_longo_prazo,
    patrimonio_liquido,
    passivo_total

FROM unificacao
    );
  
  
[0m08:35:56.799782 [debug] [Thread-1 (]: SQL status: OK in 0.711 seconds
[0m08:35:56.800882 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.801487 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m08:35:56.801487 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.802517 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.802517 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_balanco_patrimonial'
  
[0m08:35:56.802517 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.806136 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.806136 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial" rename to "fato_balanco_patrimonial__dbt_backup"
[0m08:35:56.806136 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.809155 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.810154 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */
alter table "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_tmp" rename to "fato_balanco_patrimonial"
[0m08:35:56.810662 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:56.810662 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m08:35:56.811681 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:56.811681 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: COMMIT
[0m08:35:57.001887 [debug] [Thread-1 (]: SQL status: OK in 0.190 seconds
[0m08:35:57.003893 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_balanco_patrimonial"
[0m08:35:57.003893 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_balanco_patrimonial"} */

      drop table if exists "gold_warehouse"."main"."fato_balanco_patrimonial__dbt_backup" cascade
    
[0m08:35:57.006495 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:57.007520 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_balanco_patrimonial: Close
[0m08:35:57.008518 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092E4EBEC0>]}
[0m08:35:57.008518 [info ] [Thread-1 (]: 4 of 59 OK created sql table model main.fato_balanco_patrimonial ............... [[32mOK[0m in 0.93s]
[0m08:35:57.009516 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_balanco_patrimonial
[0m08:35:57.009516 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m08:35:57.010619 [info ] [Thread-1 (]: 5 of 59 START sql table model main.fato_demonstracao_resultado ................. [RUN]
[0m08:35:57.010619 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_balanco_patrimonial, now model.bacen_ifdata_analytics.fato_demonstracao_resultado)
[0m08:35:57.011856 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m08:35:57.015545 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.016645 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m08:35:57.019354 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.019354 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.019354 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: BEGIN
[0m08:35:57.020961 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:57.020961 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:57.020961 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.022000 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp"
  
    as (
      

WITH summary_prudential AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."prudential_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_financial AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."financial_conglomerates_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

summary_individual AS (
    SELECT 
        codigo, 
        data_base, 
        ativo_total,
        patrimonio_liquido,
        lucro_liquido 
    FROM "silver"."main"."individual_institutions_summary"
    QUALIFY ROW_NUMBER() OVER (PARTITION BY codigo, data_base ORDER BY ativo_total DESC) = 1
),

dre AS (
    -- Conglomerados Prudenciais
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.rendas_operacoes_cambio as resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_participacao as resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_proprio as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_income_statement" dre
    LEFT JOIN summary_prudential r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        dre.codigo,
        dre.data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_income_statement" dre
    LEFT JOIN summary_financial r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base

    UNION ALL

    -- Instituições Individuais
    SELECT
        dre.codigo,
        dre.data_base,
        'Instituicao Individual' as tipo_instituicao,
        -- Receitas
        dre.receitas_intermediacao_financeira,
        dre.rendas_operacoes_de_credito,
        dre.rendas_operacoes_de_arrendamento_mercantil,
        dre.rendas_operacoes_tvm,
        dre.rendas_operacoes_instrumentos_financeiros_derivativos,
        dre.resultado_operacoes_cambio,
        dre.rendas_aplicacoes_compulsorias,
        -- Despesas
        dre.despesas_intermediacao_financeira,
        dre.despesas_captacao,
        dre.despesas_obrigacoes_emprestimos_repasses,
        dre.despesas_operacoes_arrendamento_mercantil,
        dre.despesas_operacoes_cambio,
        dre.resultado_provisao_creditos_dificil_liquidacao,
        -- Resultados Intermediacao
        dre.resultado_intermediacao_financeira,
        -- Outras Receitas/Despesas
        dre.rendas_prestacao_servicos,
        dre.rendas_tarifas_bancarias,
        dre.despesas_pessoal,
        dre.despesas_administrativas,
        dre.despesas_tributarias,
        dre.resultado_participacoes,
        dre.outras_receitas_operacionais,
        dre.outras_despesas_operacionais,
        dre.outras_receitas_despesas_operacionais,
        -- Resultado Operacional
        dre.resultado_operacional,
        -- Resultado Nao Operacional
        dre.resultado_nao_operacional,
        -- Apuracao Final
        dre.resultado_antes_tributacao_lucro_participacao,
        dre.imposto_renda_contribuicao_social,
        dre.participacao_lucros,
        dre.lucro_liquido,
        dre.juros_sobre_capital_social_cooperativas as juros_sobre_capital,
        (r.lucro_liquido / NULLIF(r.patrimonio_liquido, 0)) as roe,
        (r.lucro_liquido / NULLIF(r.ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_income_statement" dre
    LEFT JOIN summary_individual r
      ON dre.codigo = r.codigo AND dre.data_base = r.data_base
)

SELECT
    
    
        md5(cast(cast(codigo as bigint) as varchar) || tipo_instituicao)
    
 as id_instituicao,
    
    strftime(try_cast(data_base as date), '%Y%m%d')::int
 as id_data,
    -- Receitas
    receitas_intermediacao_financeira,
    rendas_operacoes_de_credito,
    rendas_operacoes_de_arrendamento_mercantil,
    rendas_operacoes_tvm,
    rendas_operacoes_instrumentos_financeiros_derivativos,
    resultado_operacoes_cambio,
    rendas_aplicacoes_compulsorias,
    -- Despesas
    despesas_intermediacao_financeira,
    despesas_captacao,
    despesas_obrigacoes_emprestimos_repasses,
    despesas_operacoes_arrendamento_mercantil,
    despesas_operacoes_cambio,
    resultado_provisao_creditos_dificil_liquidacao,
    -- Intermediacao
    resultado_intermediacao_financeira,
    -- Outras
    rendas_prestacao_servicos,
    rendas_tarifas_bancarias,
    despesas_pessoal,
    despesas_administrativas,
    despesas_tributarias,
    resultado_participacoes,
    outras_receitas_operacionais,
    outras_despesas_operacionais,
    outras_receitas_despesas_operacionais,
    -- Resultados
    resultado_operacional,
    resultado_nao_operacional,
    resultado_antes_tributacao_lucro_participacao as resultado_antes_tributacao,
    imposto_renda_contribuicao_social,
    participacao_lucros,
    lucro_liquido,
    juros_sobre_capital,
    roe,
    roa
FROM dre
    );
  
  
[0m08:35:57.604873 [debug] [Thread-1 (]: SQL status: OK in 0.582 seconds
[0m08:35:57.606428 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.606952 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_demonstracao_resultado'
  
[0m08:35:57.606952 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:57.607964 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.608978 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_demonstracao_resultado'
  
[0m08:35:57.608978 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:57.611491 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.611491 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado" rename to "fato_demonstracao_resultado__dbt_backup"
[0m08:35:57.613018 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:57.615201 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.615765 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */
alter table "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_tmp" rename to "fato_demonstracao_resultado"
[0m08:35:57.616369 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:57.616928 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m08:35:57.616928 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.617971 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: COMMIT
[0m08:35:57.772215 [debug] [Thread-1 (]: SQL status: OK in 0.154 seconds
[0m08:35:57.775477 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_demonstracao_resultado"
[0m08:35:57.776508 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_demonstracao_resultado"} */

      drop table if exists "gold_warehouse"."main"."fato_demonstracao_resultado__dbt_backup" cascade
    
[0m08:35:57.777482 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:57.779992 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_demonstracao_resultado: Close
[0m08:35:57.780498 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092C416D20>]}
[0m08:35:57.781001 [info ] [Thread-1 (]: 5 of 59 OK created sql table model main.fato_demonstracao_resultado ............ [[32mOK[0m in 0.77s]
[0m08:35:57.781001 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_demonstracao_resultado
[0m08:35:57.782007 [debug] [Thread-1 (]: Began running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m08:35:57.782007 [info ] [Thread-1 (]: 6 of 59 START sql table model main.fato_resumo_financeiro ...................... [RUN]
[0m08:35:57.783114 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_demonstracao_resultado, now model.bacen_ifdata_analytics.fato_resumo_financeiro)
[0m08:35:57.783114 [debug] [Thread-1 (]: Began compiling node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m08:35:57.786299 [debug] [Thread-1 (]: Writing injected SQL for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:57.787805 [debug] [Thread-1 (]: Began executing node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m08:35:57.791913 [debug] [Thread-1 (]: Writing runtime sql for node "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:57.793528 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:57.793528 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: BEGIN
[0m08:35:57.793528 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:57.795076 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:57.795076 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:57.796083 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

  
    
    

    create  table
      "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp"
  
    as (
      

WITH dados_brutos AS (
    -- Conglomerados Prudenciais
    SELECT
        codigo,
        data_base,
        'Conglomerado Prudencial' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."prudential_conglomerates_summary"

    UNION ALL

    -- Conglomerados Financeiros
    SELECT
        codigo,
        data_base,
        'Conglomerado Financeiro' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."financial_conglomerates_summary"

    UNION ALL

    -- Instituições Independentes
    SELECT
        codigo,
        data_base,
        'Instituicao Individual' as tipo_instituicao,
        ativo_total,
        carteira_de_credito_classificada as carteira_credito,
        passivo_circulante_e_exigivel_a_longo_prazo as passivo_exigivel,
        captacoes,
        patrimonio_liquido,
        lucro_liquido,
        numero_de_agencias as quantidade_agencias,
        numero_de_postos_de_atendimento as quantidade_postos_atendimento,
        (lucro_liquido / NULLIF(patrimonio_liquido, 0)) as roe,
        (lucro_liquido / NULLIF(ativo_total, 0)) as roa
    FROM "silver"."main"."individual_institutions_summary"
)

SELECT
    
    
        md5(cast(cast(d.codigo as bigint) as varchar) || d.tipo_instituicao)
    
 as id_instituicao, -- FK para dim_instituicao
    
    strftime(try_cast(d.data_base as date), '%Y%m%d')::int
 as id_data,  -- FK para dim_tempo

    -- Métricas
    d.ativo_total,
    d.carteira_credito,
    d.passivo_exigivel,
    d.captacoes,
    d.patrimonio_liquido,
    d.lucro_liquido,
    d.quantidade_agencias,
    d.quantidade_postos_atendimento,
    d.roe,
    d.roa

FROM dados_brutos d
    );
  
  
[0m08:35:58.109645 [debug] [Thread-1 (]: SQL status: OK in 0.313 seconds
[0m08:35:58.110742 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:58.110742 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT index_name
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m08:35:58.111777 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.111777 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:58.111777 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

    SELECT COUNT(*) as remaining_indexes
    FROM duckdb_indexes()
    WHERE schema_name = 'main'
      AND table_name = 'fato_resumo_financeiro'
  
[0m08:35:58.113310 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.115366 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:58.115366 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro" rename to "fato_resumo_financeiro__dbt_backup"
[0m08:35:58.116950 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.119472 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:58.119472 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */
alter table "gold_warehouse"."main"."fato_resumo_financeiro__dbt_tmp" rename to "fato_resumo_financeiro"
[0m08:35:58.119472 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.120979 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m08:35:58.121986 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:58.121986 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: COMMIT
[0m08:35:58.272193 [debug] [Thread-1 (]: SQL status: OK in 0.150 seconds
[0m08:35:58.274273 [debug] [Thread-1 (]: Using duckdb connection "model.bacen_ifdata_analytics.fato_resumo_financeiro"
[0m08:35:58.274896 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "model.bacen_ifdata_analytics.fato_resumo_financeiro"} */

      drop table if exists "gold_warehouse"."main"."fato_resumo_financeiro__dbt_backup" cascade
    
[0m08:35:58.276596 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.277612 [debug] [Thread-1 (]: On model.bacen_ifdata_analytics.fato_resumo_financeiro: Close
[0m08:35:58.277612 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092C4BDF10>]}
[0m08:35:58.277612 [info ] [Thread-1 (]: 6 of 59 OK created sql table model main.fato_resumo_financeiro ................. [[32mOK[0m in 0.49s]
[0m08:35:58.279119 [debug] [Thread-1 (]: Finished running node model.bacen_ifdata_analytics.fato_resumo_financeiro
[0m08:35:58.279706 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m08:35:58.279706 [info ] [Thread-1 (]: 7 of 59 START seed file main.seed_dim_classe_instituicao ....................... [RUN]
[0m08:35:58.279706 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly model.bacen_ifdata_analytics.fato_resumo_financeiro, now seed.bacen_ifdata_analytics.seed_dim_classe_instituicao)
[0m08:35:58.279706 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m08:35:58.281391 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m08:35:58.300526 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:35:58.301102 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: BEGIN
[0m08:35:58.301102 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.301787 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.301787 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:35:58.301787 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"} */
truncate table "gold_warehouse"."main"."seed_dim_classe_instituicao"
[0m08:35:58.303792 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:58.313174 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:35:58.313174 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: 
          COPY "gold_warehouse"."main"."seed_dim_classe_instituicao" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_classe_instituicao.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:35:58.321933 [debug] [Thread-1 (]: SQL status: OK in 0.008 seconds
[0m08:35:58.326038 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:35:58.328038 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m08:35:58.328038 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_classe_instituicao"
[0m08:35:58.328038 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: COMMIT
[0m08:35:58.330578 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:58.331089 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_classe_instituicao: Close
[0m08:35:58.332095 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092E4E2750>]}
[0m08:35:58.332095 [info ] [Thread-1 (]: 7 of 59 OK loaded seed file main.seed_dim_classe_instituicao ................... [[32mINSERT 32[0m in 0.05s]
[0m08:35:58.333105 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_classe_instituicao
[0m08:35:58.333105 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m08:35:58.333105 [info ] [Thread-1 (]: 8 of 59 START seed file main.seed_dim_consolidado .............................. [RUN]
[0m08:35:58.334259 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_classe_instituicao, now seed.bacen_ifdata_analytics.seed_dim_consolidado)
[0m08:35:58.334259 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m08:35:58.334879 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m08:35:58.338619 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:35:58.338619 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: BEGIN
[0m08:35:58.339625 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.339625 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.339625 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:35:58.339625 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_consolidado"} */
truncate table "gold_warehouse"."main"."seed_dim_consolidado"
[0m08:35:58.341166 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.342196 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:35:58.342196 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: 
          COPY "gold_warehouse"."main"."seed_dim_consolidado" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_consolidado.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:35:58.343303 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.343303 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:35:58.346823 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m08:35:58.346823 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_consolidado"
[0m08:35:58.347359 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: COMMIT
[0m08:35:58.348431 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.348995 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_consolidado: Close
[0m08:35:58.349652 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092E561BB0>]}
[0m08:35:58.349652 [info ] [Thread-1 (]: 8 of 59 OK loaded seed file main.seed_dim_consolidado .......................... [[32mINSERT 8[0m in 0.02s]
[0m08:35:58.350657 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_consolidado
[0m08:35:58.351163 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m08:35:58.351163 [info ] [Thread-1 (]: 9 of 59 START seed file main.seed_dim_controle ................................. [RUN]
[0m08:35:58.351759 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_consolidado, now seed.bacen_ifdata_analytics.seed_dim_controle)
[0m08:35:58.351759 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_controle
[0m08:35:58.352766 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_controle
[0m08:35:58.423109 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:35:58.423692 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: BEGIN
[0m08:35:58.423692 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.424718 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.424718 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:35:58.425224 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_controle"} */
truncate table "gold_warehouse"."main"."seed_dim_controle"
[0m08:35:58.425224 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.426247 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:35:58.426247 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: 
          COPY "gold_warehouse"."main"."seed_dim_controle" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_controle.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:35:58.428231 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.429243 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:35:58.430887 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m08:35:58.431393 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_controle"
[0m08:35:58.431393 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: COMMIT
[0m08:35:58.433027 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.433671 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_controle: Close
[0m08:35:58.434443 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092E5371A0>]}
[0m08:35:58.434443 [info ] [Thread-1 (]: 9 of 59 OK loaded seed file main.seed_dim_controle ............................. [[32mINSERT 3[0m in 0.08s]
[0m08:35:58.435449 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_controle
[0m08:35:58.435449 [debug] [Thread-1 (]: Began running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m08:35:58.435959 [info ] [Thread-1 (]: 10 of 59 START seed file main.seed_dim_segmento ................................ [RUN]
[0m08:35:58.435959 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_controle, now seed.bacen_ifdata_analytics.seed_dim_segmento)
[0m08:35:58.435959 [debug] [Thread-1 (]: Began compiling node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m08:35:58.435959 [debug] [Thread-1 (]: Began executing node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m08:35:58.441488 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:35:58.441488 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: BEGIN
[0m08:35:58.442014 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.442014 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.442014 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:35:58.442014 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "seed.bacen_ifdata_analytics.seed_dim_segmento"} */
truncate table "gold_warehouse"."main"."seed_dim_segmento"
[0m08:35:58.443728 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.444736 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:35:58.445241 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: 
          COPY "gold_warehouse"."main"."seed_dim_segmento" FROM 'C:\WorkspaceHub\SourceHub\bacen-ifdata-scraper\src\bacen_ifdata\data_analytics\seeds\seed_dim_segmento.csv' (FORMAT CSV, HEADER TRUE, DELIMITER ',')
        ...
[0m08:35:58.446835 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.446835 [debug] [Thread-1 (]: Writing runtime SQL for node "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:35:58.448452 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m08:35:58.449079 [debug] [Thread-1 (]: Using duckdb connection "seed.bacen_ifdata_analytics.seed_dim_segmento"
[0m08:35:58.449079 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: COMMIT
[0m08:35:58.450692 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.451227 [debug] [Thread-1 (]: On seed.bacen_ifdata_analytics.seed_dim_segmento: Close
[0m08:35:58.451774 [debug] [Thread-1 (]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '623e94ac-f130-4735-aa62-c02d4b3bc328', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x000002092E4CAE10>]}
[0m08:35:58.451774 [info ] [Thread-1 (]: 10 of 59 OK loaded seed file main.seed_dim_segmento ............................ [[32mINSERT 5[0m in 0.02s]
[0m08:35:58.452790 [debug] [Thread-1 (]: Finished running node seed.bacen_ifdata_analytics.seed_dim_segmento
[0m08:35:58.452790 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m08:35:58.452790 [info ] [Thread-1 (]: 11 of 59 START test not_null_dim_instituicao_id_instituicao .................... [RUN]
[0m08:35:58.454291 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly seed.bacen_ifdata_analytics.seed_dim_segmento, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed)
[0m08:35:58.454291 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m08:35:58.463194 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m08:35:58.464199 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m08:35:58.477321 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m08:35:58.478323 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m08:35:58.479324 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: BEGIN
[0m08:35:58.479324 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.479829 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.479829 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"
[0m08:35:58.479829 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.481578 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.485511 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: ROLLBACK
[0m08:35:58.486523 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed'
[0m08:35:58.487539 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed: Close
[0m08:35:58.488063 [info ] [Thread-1 (]: 11 of 59 PASS not_null_dim_instituicao_id_instituicao .......................... [[32mPASS[0m in 0.03s]
[0m08:35:58.488763 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed
[0m08:35:58.488763 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m08:35:58.489767 [info ] [Thread-1 (]: 12 of 59 START test not_null_dim_instituicao_id_localizacao .................... [RUN]
[0m08:35:58.489767 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_instituicao.e7ffecebed, now test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957)
[0m08:35:58.490768 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m08:35:58.494981 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m08:35:58.497377 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m08:35:58.502633 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m08:35:58.502633 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m08:35:58.502633 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: BEGIN
[0m08:35:58.502633 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.504139 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.504139 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"
[0m08:35:58.504139 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_instituicao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.505844 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.506849 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: ROLLBACK
[0m08:35:58.507851 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957'
[0m08:35:58.508851 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957: Close
[0m08:35:58.508851 [info ] [Thread-1 (]: 12 of 59 PASS not_null_dim_instituicao_id_localizacao .......................... [[32mPASS[0m in 0.02s]
[0m08:35:58.509849 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957
[0m08:35:58.510469 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m08:35:58.510469 [info ] [Thread-1 (]: 13 of 59 START test relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:35:58.510469 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_instituicao_id_localizacao.1d4024c957, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c)
[0m08:35:58.511475 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m08:35:58.515691 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m08:35:58.516213 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m08:35:58.519828 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m08:35:58.521362 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m08:35:58.521362 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: BEGIN
[0m08:35:58.521870 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.521870 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.521870 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"
[0m08:35:58.521870 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.528404 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m08:35:58.529908 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: ROLLBACK
[0m08:35:58.531083 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c'
[0m08:35:58.531083 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c: Close
[0m08:35:58.532095 [info ] [Thread-1 (]: 13 of 59 PASS relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:35:58.532095 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c
[0m08:35:58.532095 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m08:35:58.533443 [info ] [Thread-1 (]: 14 of 59 START test relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:35:58.533965 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_instituicao__id_instituicao__ref_dim_instituicao_.b9c1b22f8c, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29)
[0m08:35:58.533965 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m08:35:58.537526 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m08:35:58.538731 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m08:35:58.539756 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m08:35:58.541264 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m08:35:58.541264 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: BEGIN
[0m08:35:58.542270 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.542270 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.542270 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"
[0m08:35:58.542270 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.547504 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:35:58.549023 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: ROLLBACK
[0m08:35:58.549696 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29'
[0m08:35:58.549696 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29: Close
[0m08:35:58.550703 [info ] [Thread-1 (]: 14 of 59 PASS relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:35:58.551841 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29
[0m08:35:58.551841 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m08:35:58.551841 [info ] [Thread-1 (]: 15 of 59 START test relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:35:58.552848 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_instituicao__id_instituicao__ref_dim_instituicao_.d0e42b7f29, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33)
[0m08:35:58.552848 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m08:35:58.557377 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m08:35:58.558161 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m08:35:58.559588 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m08:35:58.560626 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m08:35:58.561710 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: BEGIN
[0m08:35:58.562447 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.563456 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.564527 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"
[0m08:35:58.564527 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.569143 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:35:58.570761 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: ROLLBACK
[0m08:35:58.570761 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33'
[0m08:35:58.571785 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33: Close
[0m08:35:58.571785 [info ] [Thread-1 (]: 15 of 59 PASS relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:35:58.571785 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33
[0m08:35:58.573379 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m08:35:58.573379 [info ] [Thread-1 (]: 16 of 59 START test relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:35:58.573379 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_instituicao__id_instituicao__ref_dim_instituicao_.a79729ab33, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59)
[0m08:35:58.574383 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m08:35:58.578324 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m08:35:58.579329 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m08:35:58.580840 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m08:35:58.582478 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m08:35:58.582478 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: BEGIN
[0m08:35:58.582988 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.583507 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.583507 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"
[0m08:35:58.584067 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.587518 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:35:58.588707 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: ROLLBACK
[0m08:35:58.589720 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59'
[0m08:35:58.589720 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59: Close
[0m08:35:58.590720 [info ] [Thread-1 (]: 16 of 59 PASS relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:35:58.590720 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59
[0m08:35:58.590720 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m08:35:58.590720 [info ] [Thread-1 (]: 17 of 59 START test relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:35:58.590720 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_instituicao__id_instituicao__ref_dim_instituicao_.dbd2e3bb59, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871)
[0m08:35:58.592611 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m08:35:58.596384 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m08:35:58.597077 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m08:35:58.599947 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m08:35:58.600959 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m08:35:58.601500 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: BEGIN
[0m08:35:58.601500 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.601500 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.602504 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"
[0m08:35:58.602504 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.608089 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m08:35:58.609091 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: ROLLBACK
[0m08:35:58.610600 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871'
[0m08:35:58.611120 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871: Close
[0m08:35:58.611120 [info ] [Thread-1 (]: 17 of 59 PASS relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:35:58.612126 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871
[0m08:35:58.612126 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m08:35:58.613127 [info ] [Thread-1 (]: 18 of 59 START test unique_dim_instituicao_id_instituicao ...................... [RUN]
[0m08:35:58.613632 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_instituicao__id_instituicao__ref_dim_instituicao_.283993c871, now test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37)
[0m08:35:58.613632 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m08:35:58.618954 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m08:35:58.619460 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m08:35:58.623029 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m08:35:58.623029 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m08:35:58.624959 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: BEGIN
[0m08:35:58.625464 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.625991 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.626999 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"
[0m08:35:58.626999 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_instituicao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_instituicao"
where id_instituicao is not null
group by id_instituicao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:35:58.630914 [debug] [Thread-1 (]: SQL status: OK in 0.004 seconds
[0m08:35:58.631920 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: ROLLBACK
[0m08:35:58.633426 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37'
[0m08:35:58.633426 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37: Close
[0m08:35:58.633996 [info ] [Thread-1 (]: 18 of 59 PASS unique_dim_instituicao_id_instituicao ............................ [[32mPASS[0m in 0.02s]
[0m08:35:58.633996 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37
[0m08:35:58.635001 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m08:35:58.635506 [info ] [Thread-1 (]: 19 of 59 START test not_null_dim_localizacao_id_localizacao .................... [RUN]
[0m08:35:58.635506 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_instituicao_id_instituicao.8d88b5eb37, now test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd)
[0m08:35:58.635506 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m08:35:58.639582 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m08:35:58.639582 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m08:35:58.642255 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m08:35:58.643263 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m08:35:58.643263 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: BEGIN
[0m08:35:58.643263 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.644954 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.644954 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"
[0m08:35:58.645959 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_localizacao
from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.647037 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.647037 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: ROLLBACK
[0m08:35:58.648644 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd'
[0m08:35:58.648644 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd: Close
[0m08:35:58.649276 [info ] [Thread-1 (]: 19 of 59 PASS not_null_dim_localizacao_id_localizacao .......................... [[32mPASS[0m in 0.01s]
[0m08:35:58.650470 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd
[0m08:35:58.650470 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m08:35:58.651143 [info ] [Thread-1 (]: 20 of 59 START test relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [RUN]
[0m08:35:58.651683 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_localizacao_id_localizacao.b7b72d01cd, now test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42)
[0m08:35:58.651683 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m08:35:58.656862 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m08:35:58.657613 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m08:35:58.660124 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m08:35:58.661666 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m08:35:58.661666 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: BEGIN
[0m08:35:58.661666 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.661666 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.661666 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"
[0m08:35:58.663189 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_localizacao as from_field
    from "gold_warehouse"."main"."dim_instituicao"
    where id_localizacao is not null
),

parent as (
    select id_localizacao as to_field
    from "gold_warehouse"."main"."dim_localizacao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.665220 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:58.666834 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: ROLLBACK
[0m08:35:58.667339 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42'
[0m08:35:58.669029 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42: Close
[0m08:35:58.669029 [info ] [Thread-1 (]: 20 of 59 PASS relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_  [[32mPASS[0m in 0.02s]
[0m08:35:58.670035 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42
[0m08:35:58.671035 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m08:35:58.671539 [info ] [Thread-1 (]: 21 of 59 START test unique_dim_localizacao_id_localizacao ...................... [RUN]
[0m08:35:58.672042 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_dim_instituicao_id_localizacao__id_localizacao__ref_dim_localizacao_.f94399be42, now test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb)
[0m08:35:58.672715 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m08:35:58.677435 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m08:35:58.678436 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m08:35:58.681448 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m08:35:58.683463 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m08:35:58.684048 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: BEGIN
[0m08:35:58.684048 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.684647 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.685224 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"
[0m08:35:58.685224 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_localizacao as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_localizacao"
where id_localizacao is not null
group by id_localizacao
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:35:58.690038 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:35:58.692044 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: ROLLBACK
[0m08:35:58.692044 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb'
[0m08:35:58.693612 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb: Close
[0m08:35:58.693612 [info ] [Thread-1 (]: 21 of 59 PASS unique_dim_localizacao_id_localizacao ............................ [[32mPASS[0m in 0.02s]
[0m08:35:58.694616 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb
[0m08:35:58.695120 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m08:35:58.695120 [info ] [Thread-1 (]: 22 of 59 START test not_null_dim_tempo_id_data ................................. [RUN]
[0m08:35:58.696123 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_localizacao_id_localizacao.7ffdbf30fb, now test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40)
[0m08:35:58.696123 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m08:35:58.699533 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m08:35:58.701634 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m08:35:58.703637 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m08:35:58.704690 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m08:35:58.704690 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: BEGIN
[0m08:35:58.705696 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.705696 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.706804 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"
[0m08:35:58.706804 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."dim_tempo"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.707801 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.708803 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: ROLLBACK
[0m08:35:58.709803 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40'
[0m08:35:58.709803 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40: Close
[0m08:35:58.710431 [info ] [Thread-1 (]: 22 of 59 PASS not_null_dim_tempo_id_data ....................................... [[32mPASS[0m in 0.01s]
[0m08:35:58.710986 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40
[0m08:35:58.711999 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m08:35:58.711999 [info ] [Thread-1 (]: 23 of 59 START test relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:35:58.713000 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_dim_tempo_id_data.a5b84d4e40, now test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391)
[0m08:35:58.713000 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m08:35:58.717059 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m08:35:58.719051 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m08:35:58.721176 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m08:35:58.723227 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m08:35:58.723227 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: BEGIN
[0m08:35:58.723227 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.724865 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.724865 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"
[0m08:35:58.725457 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_capital_prudencial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.727472 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:58.729472 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: ROLLBACK
[0m08:35:58.730023 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391'
[0m08:35:58.731045 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391: Close
[0m08:35:58.731045 [info ] [Thread-1 (]: 23 of 59 PASS relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m08:35:58.732210 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391
[0m08:35:58.732210 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m08:35:58.732210 [info ] [Thread-1 (]: 24 of 59 START test relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:35:58.734022 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_capital_prudencial_id_data__id_data__ref_dim_tempo_.5faa199391, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a)
[0m08:35:58.734022 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m08:35:58.738345 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m08:35:58.739350 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m08:35:58.740856 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m08:35:58.742542 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m08:35:58.743560 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: BEGIN
[0m08:35:58.744066 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.744571 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.744571 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"
[0m08:35:58.744571 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_indexador"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.762700 [debug] [Thread-1 (]: SQL status: OK in 0.017 seconds
[0m08:35:58.764220 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: ROLLBACK
[0m08:35:58.764726 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a'
[0m08:35:58.765231 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a: Close
[0m08:35:58.765772 [info ] [Thread-1 (]: 24 of 59 PASS relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.03s]
[0m08:35:58.766310 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a
[0m08:35:58.766831 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m08:35:58.766831 [info ] [Thread-1 (]: 25 of 59 START test relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:35:58.766831 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_indexador_id_data__id_data__ref_dim_tempo_.bdd0239a0a, now test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510)
[0m08:35:58.767836 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m08:35:58.770870 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m08:35:58.772383 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m08:35:58.774395 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m08:35:58.774900 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m08:35:58.775545 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: BEGIN
[0m08:35:58.775545 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.775545 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.776552 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"
[0m08:35:58.776552 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_carteira_credito_totais"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.779058 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:58.779600 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: ROLLBACK
[0m08:35:58.779600 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510'
[0m08:35:58.781254 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510: Close
[0m08:35:58.781254 [info ] [Thread-1 (]: 25 of 59 PASS relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.01s]
[0m08:35:58.781943 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510
[0m08:35:58.781943 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m08:35:58.782951 [info ] [Thread-1 (]: 26 of 59 START test relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:35:58.783457 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_carteira_credito_totais_id_data__id_data__ref_dim_tempo_.621b7c2510, now test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013)
[0m08:35:58.784098 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m08:35:58.788319 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m08:35:58.789328 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m08:35:58.790834 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m08:35:58.792351 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m08:35:58.792351 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: BEGIN
[0m08:35:58.792351 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.793383 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.793383 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"
[0m08:35:58.793383 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_movimentacao_cambio"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.794968 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.796719 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: ROLLBACK
[0m08:35:58.797505 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013'
[0m08:35:58.798528 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013: Close
[0m08:35:58.798528 [info ] [Thread-1 (]: 26 of 59 PASS relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m08:35:58.799133 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013
[0m08:35:58.799678 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m08:35:58.799678 [info ] [Thread-1 (]: 27 of 59 START test relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:35:58.800685 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_movimentacao_cambio_id_data__id_data__ref_dim_tempo_.61d7ac8013, now test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5)
[0m08:35:58.801191 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m08:35:58.805431 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m08:35:58.806436 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m08:35:58.810541 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m08:35:58.811558 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m08:35:58.811558 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: BEGIN
[0m08:35:58.811558 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.813065 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.813527 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"
[0m08:35:58.814072 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_operacoes_clientes"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.816674 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:58.817682 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: ROLLBACK
[0m08:35:58.819185 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5'
[0m08:35:58.819185 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5: Close
[0m08:35:58.819185 [info ] [Thread-1 (]: 27 of 59 PASS relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m08:35:58.820768 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5
[0m08:35:58.820768 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m08:35:58.821773 [info ] [Thread-1 (]: 28 of 59 START test unique_dim_tempo_id_data ................................... [RUN]
[0m08:35:58.821773 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_operacoes_clientes_id_data__id_data__ref_dim_tempo_.9db571ddf5, now test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e)
[0m08:35:58.821773 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m08:35:58.825193 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m08:35:58.826198 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m08:35:58.828200 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m08:35:58.829705 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m08:35:58.829705 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: BEGIN
[0m08:35:58.829705 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.831281 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.831830 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"
[0m08:35:58.831830 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

select
    id_data as unique_field,
    count(*) as n_records

from "gold_warehouse"."main"."dim_tempo"
where id_data is not null
group by id_data
having count(*) > 1



  
  
      
    ) dbt_internal_test
[0m08:35:58.833922 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:58.835462 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: ROLLBACK
[0m08:35:58.835462 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e'
[0m08:35:58.836486 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e: Close
[0m08:35:58.836486 [info ] [Thread-1 (]: 28 of 59 PASS unique_dim_tempo_id_data ......................................... [[32mPASS[0m in 0.01s]
[0m08:35:58.837975 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e
[0m08:35:58.837975 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m08:35:58.838505 [info ] [Thread-1 (]: 29 of 59 START test not_null_fato_balanco_patrimonial_id_data .................. [RUN]
[0m08:35:58.838505 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.unique_dim_tempo_id_data.1a1f165e3e, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6)
[0m08:35:58.838505 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m08:35:58.842078 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m08:35:58.843166 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m08:35:58.844746 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m08:35:58.846280 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m08:35:58.846815 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: BEGIN
[0m08:35:58.846815 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.847338 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.847338 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"
[0m08:35:58.847338 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.848850 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.849420 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: ROLLBACK
[0m08:35:58.850939 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6'
[0m08:35:58.850939 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6: Close
[0m08:35:58.851517 [info ] [Thread-1 (]: 29 of 59 PASS not_null_fato_balanco_patrimonial_id_data ........................ [[32mPASS[0m in 0.01s]
[0m08:35:58.851517 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6
[0m08:35:58.852534 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m08:35:58.852534 [info ] [Thread-1 (]: 30 of 59 START test not_null_fato_balanco_patrimonial_id_instituicao ........... [RUN]
[0m08:35:58.852534 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_data.4df3b968e6, now test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939)
[0m08:35:58.854039 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m08:35:58.856633 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m08:35:58.858611 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m08:35:58.860617 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m08:35:58.861625 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m08:35:58.863133 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: BEGIN
[0m08:35:58.864139 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.864139 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.864139 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"
[0m08:35:58.864139 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_balanco_patrimonial"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.866129 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.867135 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: ROLLBACK
[0m08:35:58.867135 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939'
[0m08:35:58.868664 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939: Close
[0m08:35:58.869216 [info ] [Thread-1 (]: 30 of 59 PASS not_null_fato_balanco_patrimonial_id_instituicao ................. [[32mPASS[0m in 0.02s]
[0m08:35:58.869216 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939
[0m08:35:58.870223 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m08:35:58.870753 [info ] [Thread-1 (]: 31 of 59 START test relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:35:58.870753 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_balanco_patrimonial_id_instituicao.1179884939, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25)
[0m08:35:58.871758 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m08:35:58.875785 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m08:35:58.876959 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m08:35:58.877971 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m08:35:58.880119 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m08:35:58.880119 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: BEGIN
[0m08:35:58.880119 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.881151 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.881151 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"
[0m08:35:58.881151 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.885073 [debug] [Thread-1 (]: SQL status: OK in 0.003 seconds
[0m08:35:58.886097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: ROLLBACK
[0m08:35:58.886097 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25'
[0m08:35:58.886097 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25: Close
[0m08:35:58.887624 [info ] [Thread-1 (]: 31 of 59 PASS relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m08:35:58.888203 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25
[0m08:35:58.888203 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m08:35:58.888203 [info ] [Thread-1 (]: 32 of 59 START test relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:35:58.889209 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_data__id_data__ref_dim_tempo_.cddce82a25, now test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01)
[0m08:35:58.889209 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m08:35:58.895250 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m08:35:58.896258 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m08:35:58.897356 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m08:35:58.898874 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m08:35:58.899397 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: BEGIN
[0m08:35:58.899397 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.899397 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.900944 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"
[0m08:35:58.900944 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_balanco_patrimonial"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.907521 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m08:35:58.908510 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: ROLLBACK
[0m08:35:58.909509 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01'
[0m08:35:58.909509 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01: Close
[0m08:35:58.910492 [info ] [Thread-1 (]: 32 of 59 PASS relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:35:58.910492 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01
[0m08:35:58.911521 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m08:35:58.911521 [info ] [Thread-1 (]: 33 of 59 START test not_null_fato_demonstracao_resultado_id_data ............... [RUN]
[0m08:35:58.911521 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_balanco_patrimonial_id_instituicao__id_instituicao__ref_dim_instituicao_.f2884dbc01, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e)
[0m08:35:58.911521 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m08:35:58.915663 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m08:35:58.917191 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m08:35:58.918784 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m08:35:58.919440 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m08:35:58.919440 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: BEGIN
[0m08:35:58.919440 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.921526 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.921526 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"
[0m08:35:58.921526 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.923439 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.924638 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: ROLLBACK
[0m08:35:58.925236 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e'
[0m08:35:58.925236 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e: Close
[0m08:35:58.926258 [info ] [Thread-1 (]: 33 of 59 PASS not_null_fato_demonstracao_resultado_id_data ..................... [[32mPASS[0m in 0.01s]
[0m08:35:58.926763 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e
[0m08:35:58.926763 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m08:35:58.927769 [info ] [Thread-1 (]: 34 of 59 START test not_null_fato_demonstracao_resultado_id_instituicao ........ [RUN]
[0m08:35:58.927769 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_data.b7fc8fd40e, now test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6)
[0m08:35:58.927769 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m08:35:58.932399 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m08:35:58.933492 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m08:35:58.935340 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m08:35:58.936345 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m08:35:58.936345 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: BEGIN
[0m08:35:58.938300 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.939333 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.939333 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"
[0m08:35:58.939333 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_demonstracao_resultado"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.940861 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:58.941875 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: ROLLBACK
[0m08:35:58.941875 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6'
[0m08:35:58.943435 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6: Close
[0m08:35:58.943435 [info ] [Thread-1 (]: 34 of 59 PASS not_null_fato_demonstracao_resultado_id_instituicao .............. [[32mPASS[0m in 0.02s]
[0m08:35:58.943435 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6
[0m08:35:58.943435 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m08:35:58.944957 [info ] [Thread-1 (]: 35 of 59 START test relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:35:58.944957 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_demonstracao_resultado_id_instituicao.5d48c3d2c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6)
[0m08:35:58.945963 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m08:35:58.949865 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m08:35:58.950878 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m08:35:58.954423 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m08:35:58.955936 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m08:35:58.955936 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: BEGIN
[0m08:35:58.955936 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.957448 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.957448 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"
[0m08:35:58.957448 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.963176 [debug] [Thread-1 (]: SQL status: OK in 0.005 seconds
[0m08:35:58.964180 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: ROLLBACK
[0m08:35:58.964684 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6'
[0m08:35:58.964684 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6: Close
[0m08:35:58.965689 [info ] [Thread-1 (]: 35 of 59 PASS relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_  [[32mPASS[0m in 0.02s]
[0m08:35:58.966227 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6
[0m08:35:58.966834 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m08:35:58.966834 [info ] [Thread-1 (]: 36 of 59 START test relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [RUN]
[0m08:35:58.967839 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_data__id_data__ref_dim_tempo_.7bf767a7c6, now test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71)
[0m08:35:58.967839 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m08:35:58.972049 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m08:35:58.973799 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m08:35:58.975607 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m08:35:58.975607 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m08:35:58.977149 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: BEGIN
[0m08:35:58.977149 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:58.978156 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:58.978156 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"
[0m08:35:58.978156 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_instituicao as from_field
    from "gold_warehouse"."main"."fato_demonstracao_resultado"
    where id_instituicao is not null
),

parent as (
    select id_instituicao as to_field
    from "gold_warehouse"."main"."dim_instituicao"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:58.985512 [debug] [Thread-1 (]: SQL status: OK in 0.006 seconds
[0m08:35:58.986519 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: ROLLBACK
[0m08:35:58.987517 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71'
[0m08:35:58.987517 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71: Close
[0m08:35:58.988023 [info ] [Thread-1 (]: 36 of 59 PASS relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_  [[32mPASS[0m in 0.02s]
[0m08:35:58.989729 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71
[0m08:35:58.989729 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m08:35:58.989729 [info ] [Thread-1 (]: 37 of 59 START test not_null_fato_resumo_financeiro_id_data .................... [RUN]
[0m08:35:58.990745 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.relationships_fato_demonstracao_resultado_id_instituicao__id_instituicao__ref_dim_instituicao_.ef75907a71, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946)
[0m08:35:58.990745 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m08:35:58.997227 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m08:35:58.997227 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m08:35:59.000687 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m08:35:59.001818 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m08:35:59.002826 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: BEGIN
[0m08:35:59.003827 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:59.005347 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:59.006358 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"
[0m08:35:59.006358 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_data
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_data is null



  
  
      
    ) dbt_internal_test
[0m08:35:59.007356 [debug] [Thread-1 (]: SQL status: OK in 0.001 seconds
[0m08:35:59.009866 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: ROLLBACK
[0m08:35:59.011504 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946'
[0m08:35:59.011504 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946: Close
[0m08:35:59.013045 [info ] [Thread-1 (]: 37 of 59 PASS not_null_fato_resumo_financeiro_id_data .......................... [[32mPASS[0m in 0.02s]
[0m08:35:59.013045 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946
[0m08:35:59.013045 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m08:35:59.013045 [info ] [Thread-1 (]: 38 of 59 START test not_null_fato_resumo_financeiro_id_instituicao ............. [RUN]
[0m08:35:59.014588 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_data.1bbc863946, now test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7)
[0m08:35:59.014588 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m08:35:59.017181 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m08:35:59.019957 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m08:35:59.020463 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m08:35:59.022054 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m08:35:59.022054 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: BEGIN
[0m08:35:59.022054 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:59.023704 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:59.023704 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"
[0m08:35:59.024279 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    



select id_instituicao
from "gold_warehouse"."main"."fato_resumo_financeiro"
where id_instituicao is null



  
  
      
    ) dbt_internal_test
[0m08:35:59.024792 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:59.026338 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: ROLLBACK
[0m08:35:59.026338 [debug] [Thread-1 (]: Failed to rollback 'test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7'
[0m08:35:59.027338 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7: Close
[0m08:35:59.027338 [info ] [Thread-1 (]: 38 of 59 PASS not_null_fato_resumo_financeiro_id_instituicao ................... [[32mPASS[0m in 0.01s]
[0m08:35:59.028339 [debug] [Thread-1 (]: Finished running node test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7
[0m08:35:59.028339 [debug] [Thread-1 (]: Began running node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m08:35:59.029336 [info ] [Thread-1 (]: 39 of 59 START test relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_  [RUN]
[0m08:35:59.029336 [debug] [Thread-1 (]: Re-using an available connection from the pool (formerly test.bacen_ifdata_analytics.not_null_fato_resumo_financeiro_id_instituicao.40bd8e5dc7, now test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff)
[0m08:35:59.029840 [debug] [Thread-1 (]: Began compiling node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m08:35:59.033498 [debug] [Thread-1 (]: Writing injected SQL for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m08:35:59.034176 [debug] [Thread-1 (]: Began executing node test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff
[0m08:35:59.036124 [debug] [Thread-1 (]: Writing runtime sql for node "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m08:35:59.036124 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m08:35:59.037631 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: BEGIN
[0m08:35:59.037631 [debug] [Thread-1 (]: Opening a new connection, currently in state closed
[0m08:35:59.038227 [debug] [Thread-1 (]: SQL status: OK in 0.000 seconds
[0m08:35:59.038227 [debug] [Thread-1 (]: Using duckdb connection "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"
[0m08:35:59.038227 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: /* {"app": "dbt", "dbt_version": "1.11.5", "profile_name": "bacen_ifdata", "target_name": "dev", "node_id": "test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff"} */

    select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
  
    
    

with child as (
    select id_data as from_field
    from "gold_warehouse"."main"."fato_resumo_financeiro"
    where id_data is not null
),

parent as (
    select id_data as to_field
    from "gold_warehouse"."main"."dim_tempo"
)

select
    from_field

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

where parent.to_field is null



  
  
      
    ) dbt_internal_test
[0m08:35:59.041242 [debug] [Thread-1 (]: SQL status: OK in 0.002 seconds
[0m08:35:59.042416 [debug] [Thread-1 (]: On test.bacen_ifdata_analytics.relationships_fato_resumo_financeiro_id_data__id_data__ref_dim_tempo_.d11c3caeff: ROLLBACK
